4 Replies Latest reply on Dec 13, 2012 6:35 AM by Florentin Picioroaga

    java.lang.ClassNotFoundException - problem with clustering

    Tomasz Łabacki Newbie

      Hello there,

      although Infinispan is great tool, I have problem with clustering mode. Your help would be very useful.

       

      Problem: when I setup Infinispan to be able to work in clustering mode (config contents below) I had error "NotSerializableException" in some classes, so I made changes in code (now classes implements Serializable). After that changes I receive error java.lang.ClassNotFoundException. Why?

       

      Config contents:

      infinispan-cache-config.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <infinispan
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:infinispan:config:4.0 http://www.infinispan.org/schemas/infinispan-config-4.0.xsd"
            xmlns="urn:infinispan:config:4.0">
         
          <global>
              <globalJmxStatistics enabled="true"/>
      
              <transport clusterName="carrierExCluster">    
                  <properties>  
                      <property name="configurationFile" value="jgroups-options.xml" />  
                  </properties> 
              </transport>
          </global>
      
          <default>
              <jmxStatistics enabled="true"/>
              <clustering mode="replication">
                  <sync/>
              </clustering>
              
              <eviction maxEntries="-1" wakeUpInterval="10000" strategy="LRU"/>
          </default> 
      </infinispan>
      

       

      jgroups-options.xml

      <config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:jgroups      file:schema/JGroups-2.8.xsd">
            <TCP bind_port="7800" />
            <TCPPING timeout="3000"
                 initial_hosts="${jgroups.tcpping.initial_hosts:10.0.3.51[7800],10.0.3.52[7801]}"
                 port_range="0"
                 num_initial_members="2"/>
                 
           <MERGE2 max_interval="30000"  min_interval="10000"/>
             <FD_SOCK/>
            <FD timeout="10000" max_tries="5" />
            <VERIFY_SUSPECT timeout="1500"  />
            <pbcast.NAKACK
                 use_mcast_xmit="false" gc_lag="0"
                 retransmit_timeout="300,600,1200,2400,4800"
                 discard_delivered_msgs="true"/>
            <UNICAST timeout="300,600,1200" />
            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"  max_bytes="400000"/>
            <pbcast.GMS print_local_addr="true" join_timeout="3000"   view_bundling="true"/>
            <FC max_credits="2000000"  min_threshold="0.10"/>
            <FRAG2 frag_size="60000"  />
            <pbcast.STREAMING_STATE_TRANSFER/>
            
            <pbcast.FLUSH timeout="0"/>
      </config>

       

      Terminal output:

           [java] -------------------------------------------------------------------
           [java] GMS: address=localhost-13690, cluster=carrierExCluster, physical address=10.0.3.51:7800
           [java] -------------------------------------------------------------------
           [java] [ERROR] getToken: Error during operation, execute roolback:
           [java] org.infinispan.CacheException: Problems invoking command.
           [java]     at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:154)
           [java]     at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:575)
           [java]     at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:486)
           [java]     at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:362)
           [java]     at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:771)
           [java]     at org.jgroups.JChannel.up(JChannel.java:1453)
           [java]     at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:887)
           [java]     at org.jgroups.protocols.pbcast.FLUSH.up(FLUSH.java:483)
           [java]     at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.up(STREAMING_STATE_TRANSFER.java:265)
           [java]     at org.jgroups.protocols.FRAG2.up(FRAG2.java:188)
           [java]     at org.jgroups.protocols.FC.up(FC.java:494)
           [java]     at org.jgroups.protocols.pbcast.GMS.up(GMS.java:888)
           [java]     at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
           [java]     at org.jgroups.protocols.UNICAST.up(UNICAST.java:309)
           [java]     at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:813)
           [java]     at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:671)
           [java]     at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:132)
           [java]     at org.jgroups.protocols.FD.up(FD.java:266)
           [java]     at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:270)
           [java]     at org.jgroups.protocols.MERGE2.up(MERGE2.java:210)
           [java]     at org.jgroups.protocols.Discovery.up(Discovery.java:281)
           [java]     at org.jgroups.protocols.TP.passMessageUp(TP.java:1009)
           [java]     at org.jgroups.protocols.TP.access$100(TP.java:56)
           [java]     at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1549)
           [java]     at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1531)
           [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
           [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
           [java]     at java.lang.Thread.run(Thread.java:619)
           [java] Caused by: java.lang.ClassNotFoundException: pl.my-project.common.pojo.common.MyCachedData
           [java]     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           [java]     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           [java]     at java.lang.Class.forName0(Native Method)
           [java]     at java.lang.Class.forName(Class.java:247)
           [java]     at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:135)
           [java]     at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:116)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doResolveClass(RiverUnmarshaller.java:1148)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:862)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1183)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:270)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
           [java]     at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
           [java]     at org.infinispan.marshall.exts.ReplicableCommandExternalizer.readObject(ReplicableCommandExternalizer.java:75)
           [java]     at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.readObject(ConstantObjectTable.java:266)
           [java]     at org.infinispan.marshall.jboss.ConstantObjectTable.readObject(ConstantObjectTable.java:253)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:357)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
           [java]     at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
           [java]     at org.infinispan.marshall.exts.ReplicableCommandExternalizer.readObject(ReplicableCommandExternalizer.java:75)
           [java]     at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.readObject(ConstantObjectTable.java:266)
           [java]     at org.infinispan.marshall.jboss.ConstantObjectTable.readObject(ConstantObjectTable.java:253)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:357)
           [java]     at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
           [java]     at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
           [java]     at org.infinispan.marshall.jboss.GenericJBossMarshaller.objectFromObjectStream(GenericJBossMarshaller.java:162)
           [java]     at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:111)
           [java]     at org.infinispan.remoting.transport.jgroups.MarshallerAdapter.objectFromByteBuffer(MarshallerAdapter.java:26)
           [java]     at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:146)