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

java.lang.reflect.InvocationTargetException and java.lang.NullPointerException are thrown when replicateputsViaCopy=true

    Details

    • Type: Regression Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: 6.2.0 CE B3
    • Fix Version/s: 6.2.0 CE RC1
    • Labels:
      None
    • Environment:
      Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 101c0c55b3da4f5631fc2df41bc2b6416bb82e7e.
      Plugins 6.2.x EE GIT ID: e73d326e0696ade9d9dcb4bff54f0a2fc63779f0.
    • Story Points:
      7
    • Fix Priority:
      4

      Description

      Steps to reproduce:

      1. Set up two bundles.
      2. In both bundles:
      Add the following properties to the portal-ext.properties:

      cluster.link.enabled=true
      ehcache.cluster.link.replication.enabled=true
      

      Add "replicatePutsViaCopy=true" under "defaultCache" section in liferay-multi-vm-clustered.xml (turn others to true also).

      <defaultCache
      eternal="false"
      maxElementsInMemory="10000"
      overflowToDisk="false"
      timeToIdleSeconds="600"
      >
      <cacheEventListenerFactory
      class="com.liferay.portal.cache.ehcache.LiferayCacheEventListenerFactory"
      properties="replicatePutsViaCopy=true,replicatePuts=true,replicateUpdatesViaCopy=true"
      propertySeparator=","
      />
      <bootstrapCacheLoaderFactory class="com.liferay.portal.cache.ehcache.LiferayBootstrapCacheLoaderFactory" />
      </defaultCache>

      3. Deploy ehcache-cluster-web plugins in both bundles.
      4. Start up bundles in sequence.
      5. On one bundle site, go to control panel -> server administration -> script.
      Choose language as Groovy, put script as:

         com.liferay.portal.kernel.cache.PortalCache pc = com.liferay.portal.kernel.cache.MultiVMPoolUtil.getCache("testCacheId");
         pc.put("one", "ONE");
         pc.put("two", "TWO");
         pc.put("three", "THREE");
      

      then hit "Execute" button.

      Error Message 1:

      05:54:44,276 ERROR [Incoming-2,LIFERAY-CONTROL-CHANNEL,Shelton-14829][ClusterRequestReceiver:92] Una
      ble to invoke method {arguments=[{arguments=null, methodKey=com.liferay.portal.service.PortletLocalS
      ervice.clearCompanyPortletsPool)}, com.liferay.portal.service.PortletLocalService, , null, {}], meth
      odKey=com.liferay.portal.cluster.ClusterableAdvice._invoke(com.liferay.portal.kernel.util.MethodHand
      ler,java.lang.String,java.lang.String,java.lang.Class,java.util.Map)}
      java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.kernel.util.MethodHandler.invoke(MethodHandler.java:61)
              at com.liferay.portal.cluster.ClusterRequestReceiver.processClusterRequest(ClusterRequestRec
      eiver.java:237)
              at com.liferay.portal.cluster.ClusterRequestReceiver.receive(ClusterRequestReceiver.java:87)
      
              at org.jgroups.JChannel.invokeCallback(JChannel.java:749)
              at org.jgroups.JChannel.up(JChannel.java:710)
              at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1025)
              at org.jgroups.protocols.RSVP.up(RSVP.java:188)
              at org.jgroups.protocols.FRAG2.up(FRAG2.java:181)
              at org.jgroups.protocols.FlowControl.up(FlowControl.java:400)
              at org.jgroups.protocols.FlowControl.up(FlowControl.java:418)
              at org.jgroups.protocols.pbcast.GMS.up(GMS.java:896)
              at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:245)
              at org.jgroups.protocols.UNICAST2.up(UNICAST2.java:453)
              at org.jgroups.protocols.pbcast.NAKACK2.handleMessage(NAKACK2.java:763)
              at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:574)
              at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:147)
              at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:187)
              at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:288)
              at org.jgroups.protocols.MERGE3.up(MERGE3.java:290)
              at org.jgroups.protocols.Discovery.up(Discovery.java:359)
              at org.jgroups.protocols.TP.passMessageUp(TP.java:1263)
              at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1825)
              at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1793)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.InstantiationException: com.liferay.portal.service.PortletLocalService
              at java.lang.Class.newInstance0(Class.java:340)
              at java.lang.Class.newInstance(Class.java:308)
              at com.liferay.portal.kernel.util.MethodHandler.invoke(MethodHandler.java:58)
              at com.liferay.portal.cluster.ClusterableAdvice._invoke(ClusterableAdvice.java:163)
              ... 30 more
      05:55:08,444 ERROR [Incoming-1,LIFERAY-CONTROL-CHANNEL,Shelton-14829][PortletBeanLocatorUtil:87] Bea
      nLocator is null for servlet context com.liferay.portal.service.PortletLocalService
      05:55:08,446 ERROR [Incoming-1,LIFERAY-CONTROL-CHANNEL,Shelton-14829][ClusterRequestReceiver:92] Una
      ble to invoke method {arguments=[{arguments=null, methodKey=com.liferay.portal.service.PortletLocalS
      ervice.clearCompanyPortletsPool)}, com.liferay.portal.service.PortletLocalService, marketplace-portl
      et, null, {}], methodKey=com.liferay.portal.cluster.ClusterableAdvice._invoke(com.liferay.portal.ker
      nel.util.MethodHandler,java.lang.String,java.lang.String,java.lang.Class,java.util.Map)}
      java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.kernel.util.MethodHandler.invoke(MethodHandler.java:61)
              at com.liferay.portal.cluster.ClusterRequestReceiver.processClusterRequest(ClusterRequestRec
      eiver.java:237)
              at com.liferay.portal.cluster.ClusterRequestReceiver.receive(ClusterRequestReceiver.java:87)
      
              at org.jgroups.JChannel.invokeCallback(JChannel.java:749)
              at org.jgroups.JChannel.up(JChannel.java:710)
              at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1025)
              at org.jgroups.protocols.RSVP.up(RSVP.java:188)
              at org.jgroups.protocols.FRAG2.up(FRAG2.java:181)
              at org.jgroups.protocols.FlowControl.up(FlowControl.java:400)
              at org.jgroups.protocols.FlowControl.up(FlowControl.java:418)
              at org.jgroups.protocols.pbcast.GMS.up(GMS.java:896)
              at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:245)
              at org.jgroups.protocols.UNICAST2.up(UNICAST2.java:453)
              at org.jgroups.protocols.pbcast.NAKACK2.handleMessage(NAKACK2.java:763)
              at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:574)
              at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:147)
              at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:187)
              at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:288)
              at org.jgroups.protocols.MERGE3.up(MERGE3.java:290)
              at org.jgroups.protocols.Discovery.up(Discovery.java:359)
              at org.jgroups.protocols.TP.passMessageUp(TP.java:1263)
              at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1825)
              at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1793)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator has not been set for ser
      vlet context com.liferay.portal.service.PortletLocalService
              at com.liferay.portal.kernel.bean.PortletBeanLocatorUtil.locate(PortletBeanLocatorUtil.java:
      46)
              at com.liferay.portal.cluster.ClusterableAdvice._invoke(ClusterableAdvice.java:166)
              ... 30 more
      
      
      

      Error Message 2:

      05:58:02,405 ERROR [liferay/ehcache_cluster-1][ParallelDestination:92] Unable to process message {de
      stinationName=liferay/ehcache_cluster, response=null, responseDestinationName=null, responseId=null,
       payload=com.liferay.portal.kernel.dao.orm.FinderCache.com.liferay.portal.model.impl.PhoneImpl.List2
      :2647133972934363004:[]:PUT, values={CLUSTER_FORWARD_MESSAGE=true, companyId=0}}
      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.NullPointerException
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      32)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener
      .java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69
      )
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExe
      cutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor
      .java:593)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
              at com.liferay.portal.cache.cluster.clusterlink.messaging.ClusterLinkPortalCacheClusterListe
      ner.doReceive(ClusterLinkPortalCacheClusterListener.java:70)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      26)
              ... 5 more
      05:58:02,847 ERROR [liferay/ehcache_cluster-2][ParallelDestination:92] Unable to process message {de
      stinationName=liferay/ehcache_cluster, response=null, responseDestinationName=null, responseId=null,
       payload=testCacheId:two:TWO:PUT, values={CLUSTER_FORWARD_MESSAGE=true, companyId=0}}
      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.NullPointerException
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      32)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener
      .java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69
      )
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExe
      cutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor
      .java:593)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
              at com.liferay.portal.cache.cluster.clusterlink.messaging.ClusterLinkPortalCacheClusterListe
      ner.doReceive(ClusterLinkPortalCacheClusterListener.java:70)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      26)
              ... 5 more
      05:58:02,848 ERROR [liferay/ehcache_cluster-1][ParallelDestination:92] Unable to process message {de
      stinationName=liferay/ehcache_cluster, response=null, responseDestinationName=null, responseId=null,
       payload=testCacheId:three:THREE:PUT, values={CLUSTER_FORWARD_MESSAGE=true, companyId=0}}
      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.NullPointerException
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      32)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener
      .java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69
      )
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExe
      cutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor
      .java:593)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
              at com.liferay.portal.cache.cluster.clusterlink.messaging.ClusterLinkPortalCacheClusterListe
      ner.doReceive(ClusterLinkPortalCacheClusterListener.java:70)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      26)
              ... 5 more
      05:58:02,848 ERROR [liferay/ehcache_cluster-3][ParallelDestination:92] Unable to process message {de
      stinationName=liferay/ehcache_cluster, response=null, responseDestinationName=null, responseId=null,
       payload=testCacheId:one:ONE:PUT, values={CLUSTER_FORWARD_MESSAGE=true, companyId=0}}
      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.NullPointerException
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      32)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener
      .java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69
      )
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExe
      cutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor
      .java:593)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
              at com.liferay.portal.cache.cluster.clusterlink.messaging.ClusterLinkPortalCacheClusterListe
      ner.doReceive(ClusterLinkPortalCacheClusterListener.java:70)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:
      26)
              ... 5 more
      
      
      

      Expected result:
      No error will be seen in the whole process.

      Actual result:
      The Error Message 1 was thrown in first bundle when start up the second one. The Error Message 2 was thrown in second bundle when clicking on "Execute" through the portal which was started first.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shitian.zhang Shitian "Shelton" Zhang (Inactive)
              Reporter:
              shitian.zhang Shitian "Shelton" Zhang (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 7 weeks, 6 days ago

                  Packages

                  Version Package
                  6.2.0 CE RC1