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

Liferay fails to start if portal jars are expanded

    Details

      Description

      Classes are expanded when using a custom Java agent, like JRebel. This can be simulated for the global classloader with the following steps in Tomcat (CATALINA_HOME refers to the Tomcat folder):

      1. Navigate to CATALINA_HOME/lib/ext and expand portal-kernel.jar into the folder CATALINA_HOME/lib/ext/portal-kernel
      2. Delete portal-kernel.jar
      3. Navigate to CATALINA_HOME/lib/ext and expand com.liferay.petra.lang.jar into the folder CATALINA_HOME/lib/ext/com.liferay.petra.lang
      4. Delete com.liferay.petra.lang.jar
      5. Update CATALINA_HOME/conf/catalina.properties so that the common.loader property includes the newly created folders
        common.loader="${catalina.base}/lib/ext/*.jar","${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar",${catalina.base}/lib/ext/portal-kernel,${catalina.base}/lib/ext/com.liferay.petra.lang
        
      6. Start up the portal

      Expected Behavior
      The portal starts up because all classes are available on the classpath

      Actual Behavior
      The portal fails to startup with the following error message

      10-Nov-2017 05:46:03.691 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class com.liferay.portal.spring.context.PortalContextLoaderListener
       java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1
      	at com.liferay.portal.kernel.util.StringBundler.setIndex(StringBundler.java:199)
      	at com.liferay.portal.kernel.process.ClassPathUtil._buildClassPath(ClassPathUtil.java:207)
      	at com.liferay.portal.kernel.process.ClassPathUtil.initializeClassPaths(ClassPathUtil.java:152)
      	at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:218)
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:585)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      
      10-Nov-2017 05:46:03.692 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
      10-Nov-2017 05:46:03.710 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
      10-Nov-2017 05:46:03.819 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStop Exception sending context destroyed event to listener instance of class com.liferay.portal.spring.context.PortalContextLoaderListener
       com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator is not set
      	at com.liferay.portal.kernel.bean.PortalBeanLocatorUtil.locate(PortalBeanLocatorUtil.java:74)
      	at com.liferay.portal.spring.context.PortalContextLoaderListener.closeDataSource(PortalContextLoaderListener.java:379)
      	at com.liferay.portal.spring.context.PortalContextLoaderListener.contextDestroyed(PortalContextLoaderListener.java:154)
      	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4859)
      	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478)
      	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:585)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Days since last comment:
                44 weeks, 1 day ago

                Packages

                Version Package