Details

      Description

      I just found a silent bug in Liferay while trying to extend Liferay running on Jonas 5.2.1.2. 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) ?

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 11 weeks, 1 day ago