An EAR file is deployed successfuly on Websphere Traditional (For both 8.5.5 and 9.0) and having below structure:
EApplication.ear
|--> META-INF
|-->application.xml
|--> Application jars
|--> lib
---> Third party Jars
|--> webapp1
|---> META-INF
|--> MANIFEST
|----->WEB-INF
|--> classes (Contain war classes)
|--> lib (Third party lib)
|--> webapp2
|---> META-INF
|--> MANIFEST
|----->WEB-INF
|--> classes (Contain war classes)
|--> lib (Third party lib)
In WebSphere Traditional PARENT_LAST strategy is used along with separate classloader for each war. I am migrating the application to WebSphere liberty and classes and lib of war are not getting loaded by classloader. Only the EAR libraries are getting loaded. I have also tried to add classloader delegation to parentLast in server.xml for war files but not seeing any difference.
<classloader apiTypeVisibility="+third-party" delegation="parentLast"/>
Exception:
Caused by: java.lang.ClassNotFoundException: <Application class present in webapp1/WEB-INF/classes>
at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:734)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:319)
at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:706)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:578)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:545)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 134 more
server.xml:
<enterpriseApplication location="EApplication.ear">
<web-ext context-root="/webapp1" moduleName="webapp1"/>
<web-ext context-root="/webapp2" moduleName="webapp2"/>
<application-bnd>
.....................
</application-bnd>
</enterpriseApplication>
Note: If I copy the war/lib (third party lib) to EAR/lib then classloader is able to load those jars, but that might not be an standard way and still the problem persist for war/classes. Please suggest if any Websphere liberty specific configuration is needed to acheive for same. Thanks.