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

Liferay Extensions incompatible with Jonas 5.x



      I just found a silent bug in Liferay while trying to extend Liferay running on Jonas This happens while restarting Liferay after installing an extension containing an ext-service jar.

      If the extension contains an ext-service.jar, it won't be copied to the jonas/lib/ext directory. This causes errors at runtime such as NoClassDefFoundError while accessing the portal after restart.

      The bug is located in the ClassUtil class in portal-service :

      public static String getParentPath(
      ClassLoader classLoader, String className) {

      if (_log.isDebugEnabled())

      { _log.debug("Class name " + className); }

      if (!className.endsWith(_CLASS_EXTENSION))

      { className += _CLASS_EXTENSION; }

      className = StringUtil.replace(
      className, CharPool.PERIOD, CharPool.SLASH);

      className = StringUtil.replace(className, "/class", _CLASS_EXTENSION);

      URL url = classLoader.getResource(className);

      With Jonas libraries are deployed as bundles in the OSGI way, so the URL does not start with "file://xxxxxx" and is not an absolute link to the class, it is some kind of virtual address which starts with "bundle://xxxxxxxx".

      Is there another way to retrieve the lib/ext folder of Jonas (i.e. using the jonas.root environment variable) ?




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


              • Created:
                Days since last comment:
                6 years, 28 weeks, 1 day ago


                Version Package
                6.2.0 CE M4