0

I have a simple web application deployed in glassfish as a war file, and there is a class file included in a jar file under WEB-INF/lib folder

also I have a custom .class file developed and I put in under

WEB-INF/classes/...same classpath as in jar file/TheClass.class

However when I deploy the application, looks like that class file I customized does not take effect at all. But if I replace the one in the jar file, then everything is fine.

I have use the same feature on Websphere, Jboss and tomcat, all take the .class file in precedence on top of jar file.

is there any configuration I have missed in the context that cause the weird behavior?

Dreamer
  • 7,333
  • 24
  • 99
  • 179
  • found related similar thread http://stackoverflow.com/questions/19165451/using-glassfish-class-loader-delegate-false-in-war-of-ear-causes-classnotf, looks like there is jira ticket created for this situation in Glassfish but yet have a solution from glassfish – Dreamer Jul 13 '16 at 20:41
  • You cannot override class files like that. If you have two versions of the same class in the same class loader (as you do) then you have a lottery as to to which one gets executed because this behaviour is undefined. – Steve C Jul 14 '16 at 01:08

0 Answers0