Search code examples
javaclassloaderwarear

Classloading in EAR/WAR


Generally, an archive should be able to deployable on any application server as long as it conforms to the packaging standard and is not using any app server specific artifacts. But many times, there is a scenario wherein an application (say a WAR) works well on Tomcat but fails on other app server.

My questions is:

Is there any standardized/accepted way in which the classladers treat an EAR/WAR file OR every app server vendor is free to impliment their own mechanism?


Solution

  • Different app servers implement classloader (searching order of jar files) differently. There is no standard way. Some application servers give configuration options (e.g. Websphere) on whether to load child (war) or parent (application server) classes first.