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

NoSuchMethodError when using clusterlink and JGroups with config files

    Details

    • Fix Priority:
      4

      Description

      Important note: Fixing steps below in the end of description. Just let this LPS here just if someone finds the same issue.

      Steps to reproduce:

      1. Add these properties in portal-ext.properties
        portal.instance.protocol=http
        portal.instance.http.port=8080
        portal.instance.https.port=-1
        cluster.link.enabled=true
        lucene.replicate.write=true
        
        ehcache.bootstrap.cache.loader.factory=com.liferay.portal.cache.ehcache.JGroupsBootstrapCacheLoaderFactory
        ehcache.cache.event.listener.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory
        ehcache.cache.manager.peer.provider.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory
        
        cluster.link.channel.properties.control=custom_jgroups/udp-clusterlink-control.xml
        cluster.link.channel.properties.transport.0=custom_jgroups/udp-clusterlink-transport.xml
        
        net.sf.ehcache.configurationResourceName.peerProviderProperties=file=custom_jgroups/udp-hibernate.xml
        ehcache.multi.vm.config.location.peerProviderProperties=file=custom_jgroups/udp-multivm.xml
        
      2. Add the attached xml files into <TOMCAT>/webapps/WEB-INF/classes/custom_jgroups folder (udp-XXXX.xml)
      3. Startup server

      Expected results: server starts up without errors
      Actual results: There are error in logs and server doesn't startup properly:

      08:52:29,008 ERROR [localhost-startStop-1][ContextLoader:206] Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.cache.MultiVMPool' defined in class path resource [META-INF/util-spring.xml]: Cannot resolve reference to bean 'com.liferay.portal.kernel.cache.MultiVMPortalCacheManager' while setting bean property 'portalCacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.cache.MultiVMPortalCacheManager' defined in class path resource [META-INF/util-spring.xml]: Cannot create inner bean 'com.liferay.portal.cache.ehcache.EhcachePortalCacheManager#35ee4424' of type [com.liferay.portal.cache.ehcache.EhcachePortalCacheManager] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.cache.ehcache.EhcachePortalCacheManager#35ee4424' defined in class path resource [META-INF/util-spring.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.NoSuchMethodError: net.sf.ehcache.util.ClassLoaderUtil.getStandardClassLoader()Ljava/lang/ClassLoader;
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1327)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
      	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
      	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      	at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:237)
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      
      

      EDIT: For fixing the issue just add replace ehcache-jgroupsreplication.jar with the one attached.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juan.gonzalez Juan Gonzalez (Inactive)
                Reporter:
                juan.gonzalez Juan Gonzalez (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 38 weeks ago

                  Packages

                  Version Package