-
Type:
Bug
-
Status: Closed
-
Resolution: Inactive
-
Affects Version/s: 5.2.3, 5.2.9 EE, 6.0.6 GA, 6.0.11 EE, 6.1.0 CE RC1
-
Fix Version/s: None
-
Labels:None
-
Environment:WebLogic Server 10.3.3 (11g)
-
Fix Priority:3
Using Ext Plugin for changing portal-impl classes in WebLogic doesn't work.
On Tomcat (GlassFish/JBoss) the container sorts JARs in portal/WEB-INF/lib and classloader loads jars in this sorted order. WebLogic doesn't have this feature.
On the other hand WLS offers <prefer-web-inf-classes> in weblogic.xml. When enabled, classes in WEB-INF/classes are loaded first. This means, during web-app deploy WLS zip classes from WEB-INF/classes and put them into WEB-INF/lib/_wl_cls_gen.jar.
This inspired me to create new jar called _wls_test.jar in WEB-INF/lib - maybe WLS loads classes there first too. And that's really true.
Thus I see 2 easy possibilities how to fix it:
1, unzip classes from ext-...-impl.jar into portal's WEB-INF/classes dir
2, rename ext-...impl.jar into something that starts with underscore (e.g. _ext...-impl.jar ) and put it into portal's WEB-INF/lib dir instead of the original one
----------
I've attached small example:
- abc - JAR file with abc.App class
- def - WAR file with included abc.jar
- ghi - WAR file with included abc.jar and overrided abc.App class in WEB-INF/classes
- _wls_test - JAR file with overrided abc.App
- jkl - WAR file with included abc.jar and _wls_test.jar
Result after deploy to AdminServer:
http://localhost:7001/def-1.0-SNAPSHOT/ - app.App.getHello(): Hello from ABC
http://localhost:7001/ghi-1.0-SNAPSHOT/ - app.App.getHello(): Hello from GHI
http://localhost:7001/jkl-1.0-SNAPSHOT/ - app.App.getHello(): Hello from _WLS_TEST