Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-16082

Ext Plugin cannot override classes in WebLogic


    • Fix Priority:


      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




            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created:
                Days since last comment:
                4 years, 50 weeks, 3 days ago


                Version Package