6 Replies Latest reply on Oct 5, 2009 10:20 AM by Srinivas Chamarthi

    java.io.NotSerializableException: java.util.concurrent.Futu

    yuxiao Liu Newbie

      I used jbossCache in "cluster" mode, Tomcat as the servers. when I start up one server and do nothing before other one start up, it works well. but I did someting before other one start up, an exception occured. like this:

      Caused by:
      org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.topsoft.common.cacheadapt.CacheAdapterJbossImpl]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
      Caused by:
      java.lang.ExceptionInInitializerError
       at com.topsoft.common.cacheadapt.CacheAdapterJbossImpl.<init>(CacheAdapterJbossImpl.java:13)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
       at java.lang.reflect.Constructor.newInstance(Unknown Source)
       at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
       at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:752)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:717)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:876)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:876)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:876)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
       at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
       at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
       at com.topsoft.common.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:25)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3692)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
       at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
       at org.apache.catalina.startup.Embedded.start(Embedded.java:821)
       at com.topnet.util.web.EmbeddedTomcat.startup(EmbeddedTomcat.java:75)
       at com.topnet.util.web.EmbeddedTomcat.main(EmbeddedTomcat.java:87)
      Caused by: org.jboss.cache.CacheException: Unable to invoke method public void org.jboss.cache.RPCManagerImpl.start() on object instance org.jboss.cache.RPCManagerImpl@5866c1
       at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:127)
       at org.jboss.cache.factories.ComponentRegistry$PrioritizedMethod.invoke(ComponentRegistry.java:932)
       at org.jboss.cache.factories.ComponentRegistry.internalStart(ComponentRegistry.java:718)
       at org.jboss.cache.factories.ComponentRegistry.start(ComponentRegistry.java:582)
       at org.jboss.cache.invocation.CacheInvocationDelegate.start(CacheInvocationDelegate.java:279)
       at com.topsoft.common.cache.TopCacheImpl.<clinit>(TopCacheImpl.java:29)
       ... 49 more
      Caused by: java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:123)
       ... 54 more
      Caused by: org.jboss.cache.CacheException: Unable to fetch state on startup
       at org.jboss.cache.RPCManagerImpl.start(RPCManagerImpl.java:167)
       ... 59 more
      Caused by: org.jboss.cache.CacheException: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.util.concurrent.FutureTask
       at org.jboss.cache.statetransfer.DefaultStateTransferIntegrator.integrateTransientState(DefaultStateTransferIntegrator.java:95)
       at org.jboss.cache.statetransfer.DefaultStateTransferIntegrator.integrateState(DefaultStateTransferIntegrator.java:66)
       at org.jboss.cache.statetransfer.StateTransferManager.setState(StateTransferManager.java:233)
       at org.jboss.cache.statetransfer.StateTransferManager.setState(StateTransferManager.java:181)
       at org.jboss.cache.remoting.jgroups.ChannelMessageListener.setState(ChannelMessageListener.java:165)
       at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUpEvent(MessageDispatcher.java:647)
       at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:747)
       at org.jgroups.JChannel.up(JChannel.java:1069)
       at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:402)
       at org.jgroups.protocols.pbcast.STATE_TRANSFER.handleStateRsp(STATE_TRANSFER.java:421)
       at org.jgroups.protocols.pbcast.STATE_TRANSFER.up(STATE_TRANSFER.java:120)
       at org.jgroups.protocols.pbcast.GMS.up(GMS.java:780)
       at org.jgroups.protocols.FRAG2.unfragment(FRAG2.java:290)
       at org.jgroups.protocols.FRAG2.up(FRAG2.java:190)
       at org.jgroups.protocols.FC.up(FC.java:408)
       at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
       at org.jgroups.protocols.UNICAST.handleDataReceived(UNICAST.java:595)
       at org.jgroups.protocols.UNICAST.up(UNICAST.java:265)
       at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:729)
       at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:167)
       at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:300)
       at org.jgroups.protocols.FD.up(FD.java:285)
       at org.jgroups.protocols.MERGE2.up(MERGE2.java:145)
       at org.jgroups.protocols.Discovery.up(Discovery.java:245)
       at org.jgroups.protocols.TP.passMessageUp(TP.java:1126)
       at org.jgroups.protocols.TP.access$100(TP.java:48)
       at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1637)
       at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1616)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)
      Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.util.concurrent.FutureTask
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.readObject(Unknown Source)
       at java.util.concurrent.ConcurrentHashMap.readObject(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.readObject(Unknown Source)
       at java.util.HashMap.readObject(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.readObject(Unknown Source)
       at org.jboss.cache.marshall.NodeData.readExternal(NodeData.java:88)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:612)
       at org.jboss.cache.marshall.CacheMarshaller200.populateFromStream(CacheMarshaller200.java:776)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallLinkedList(CacheMarshaller200.java:715)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:578)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:522)
       at org.jboss.cache.marshall.CacheMarshaller200.objectFromObjectStream(CacheMarshaller200.java:140)
       at org.jboss.cache.marshall.VersionAwareMarshaller.objectFromObjectStream(VersionAwareMarshaller.java:326)
       at org.jboss.cache.statetransfer.DefaultStateTransferIntegrator.readNodesAsList(DefaultStateTransferIntegrator.java:284)
       at org.jboss.cache.statetransfer.DefaultStateTransferIntegrator.integrateTransientState(DefaultStateTransferIntegrator.java:243)
       at org.jboss.cache.statetransfer.DefaultStateTransferIntegrator.integrateTransientState(DefaultStateTransferIntegrator.java:82)
       ... 30 more
      Caused by: java.io.NotSerializableException: java.util.concurrent.FutureTask
       at java.io.ObjectOutputStream.writeObject0(Unknown Source)
       at java.io.ObjectOutputStream.writeObject(Unknown Source)
       at java.util.concurrent.ConcurrentHashMap.writeObject(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
       at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
       at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
       at java.io.ObjectOutputStream.writeObject0(Unknown Source)
       at java.io.ObjectOutputStream.writeObject(Unknown Source)
       at java.util.HashMap.writeObject(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
       at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
       at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
       at java.io.ObjectOutputStream.writeObject0(Unknown Source)
       at java.io.ObjectOutputStream.writeObject(Unknown Source)
       at org.jboss.cache.marshall.NodeData.writeExternal(NodeData.java:73)
       at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:398)
       at org.jboss.cache.marshall.CacheMarshaller200.marshallCollection(CacheMarshaller200.java:489)
       at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:332)
       at org.jboss.cache.marshall.CacheMarshaller200.objectToObjectStream(CacheMarshaller200.java:170)
       at org.jboss.cache.marshall.VersionAwareMarshaller.objectToObjectStream(VersionAwareMarshaller.java:255)
       at org.jboss.cache.statetransfer.DefaultStateTransferGenerator.marshallTransientState(DefaultStateTransferGenerator.java:139)
       at org.jboss.cache.statetransfer.DefaultStateTransferGenerator.generateState(DefaultStateTransferGenerator.java:57)
       at org.jboss.cache.statetransfer.StateTransferManager.getState(StateTransferManager.java:109)
       at org.jboss.cache.remoting.jgroups.ChannelMessageListener.getState(ChannelMessageListener.java:139)
       at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUpEvent(MessageDispatcher.java:629)
       at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:747)
       at org.jgroups.JChannel.up(JChannel.java:1154)
       at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:402)
       at org.jgroups.protocols.pbcast.STATE_TRANSFER.requestApplicationStates(STATE_TRANSFER.java:232)
       at org.jgroups.protocols.pbcast.STATE_TRANSFER.handleStateReq(STATE_TRANSFER.java:375)
       at org.jgroups.protocols.pbcast.STATE_TRANSFER.up(STATE_TRANSFER.java:117)
       at org.jgroups.protocols.pbcast.GMS.up(GMS.java:780)
       at org.jgroups.protocols.FRAG2.up(FRAG2.java:205)
       ... 17 more
      


      I used jbossCache 2.2.0GA version. my configure file:
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- =====================================================================
      -->
      <!-- -->
      <!-- JBoss Cache Service Configuration -->
      <!-- -->
      <!-- =====================================================================
      -->
      <server>
       <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
       name="jboss.cache:service=Cache">
       <!-- Configure the TransactionManager -->
       <attribute name="TransactionManagerLookupClass">
       com.topsoft.common.cache.CacheTransationManagerLookUp
       </attribute>
       <!-- Node locking level : SERIALIZABLE
       REPEATABLE_READ (default)
       READ_COMMITTED
       READ_UNCOMMITTED
       NONE -->
       <attribute name="IsolationLevel">READ_COMMITTED</attribute>
       <!-- Lock parent before doing node additions/removes -->
       <attribute name="LockParentForChildInsertRemove">
       true
       </attribute>
       <!-- Valid modes are LOCAL (default)
       REPL_ASYNC
       REPL_SYNC
       INVALIDATION_ASYNC
       INVALIDATION_SYNC -->
       <attribute name="CacheMode">REPL_SYNC</attribute>
       <!-- Max number of milliseconds to wait for a lock acquisition -->
       <attribute name="LockAcquisitionTimeout">15000</attribute>
       <!-- Specific eviction policy configurations. This is LRU -->
      
       <attribute name="ClusterName">JBossCache-Cluster</attribute>
      
       <depends>jgroups.mux:name=Multiplexer</depends>
       <attribute name="MultiplexerStack">
       fc-fast-minimalthreads
       </attribute>
      
       <!-- JGroups protocol stack properties.
       ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
       -->
       <attribute name="ClusterConfig">
       <config>
       <!-- UDP: if you have a multihomed machine, set the bind_addr
       attribute to the appropriate NIC IP address -->
       <!-- UDP: On Windows machines, because of the media sense feature
       being broken with multicast (even after disabling media sense)
       set the loopback attribute to true -->
       <UDP mcast_addr="228.1.2.3" mcast_port="48866"
       ip_ttl="64" ip_mcast="true" mcast_send_buf_size="150000"
       mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
       ucast_recv_buf_size="80000" loopback="false" />
       <PING timeout="2000" num_initial_members="3" />
       <MERGE2 min_interval="10000" max_interval="20000" />
       <FD shun="true" />
       <FD_SOCK />
       <VERIFY_SUSPECT timeout="1500" />
       <pbcast.NAKACK gc_lag="50"
       retransmit_timeout="600,1200,2400,4800" />
       <UNICAST timeout="600,1200,2400,4800" />
       <pbcast.STABLE desired_avg_gossip="400000" />
       <FC max_credits="2000000" min_threshold="0.10" />
       <FRAG2 frag_size="8192" />
       <pbcast.GMS join_timeout="5000" shun="true"
       print_local_addr="true" />
      
       <pbcast.STATE_TRANSFER />
      
       </config>
      
       </attribute>
      
       <!--
       The max amount of time (in milliseconds) we wait until the
       state (ie. the contents of the cache) are retrieved from
       existing members in a clustered environment
       -->
       <attribute name="StateRetrievalTimeout">20000</attribute>
      
       <!--
       Number of milliseconds to wait until all responses for a
       synchronous call have been received.
       -->
       <attribute name="SyncReplTimeout">15000</attribute>
      
       <!-- Max number of milliseconds to wait for a lock acquisition -->
       <attribute name="LockAcquisitionTimeout">10000</attribute>
       <attribute name="ShutdownHookBehavior">DEFAULT</attribute>
       <attribute name="UseLazyDeserialization">false</attribute>
      
      
       <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">5</attribute>
       <!-- This defaults to 200000 if not specified -->
       <attribute name="eventQueueSize">200000</attribute>
       <attribute name="policyClass">
       org.jboss.cache.eviction.LRUPolicy
       </attribute>
      
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToLiveSeconds">1000</attribute>
       </region>
       </config>
       </attribute>
       <attribute name="CacheLoaderConfig" replace="false">
       <config>
       <shared>false</shared>
       <cacheloader>
      
       <class>
       org.jboss.cache.loader.jdbm.JdbmCacheLoader
       </class>
       <properties>location=./topCache_cluster_temp/</properties>
       <async>false</async>
       <!-- if set to true, purges the contents of this cache loader when the cache starts up.
       Defaults to false. -->
       <purgeOnStartup>true</purgeOnStartup>
       </cacheloader>
       </config>
       </attribute>
       </mbean>
      </server>
      


      what's the matter ?