3 Replies Latest reply on Oct 14, 2008 1:57 AM by guazi

    what should I do

    guazi

      I used jbossCache2.1.1 in my application.But it has an exception when I use cluster mode.the exception like this:

      [default] - Servlet.service() for servlet default threw exception
      org.jboss.cache.CacheException: java.io.StreamCorruptedException
       at org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(Abstract
      InvocationDelegate.java:135)
       at org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(Abstract
      InvocationDelegate.java:64)
       at org.jboss.cache.invocation.CacheInvocationDelegate.get(CacheInvocatio
      nDelegate.java:387)
       at org.jboss.cache.invocation.NodeInvocationDelegate.get(NodeInvocationD
      elegate.java:409)
       at com.topsoft.common.cache.TopCacheImpl.get(TopCacheImpl.java:76)
       at com.topsoft.common.codetable.multicolumn.BaseMultiColumnCodeTable.ini
      tData(BaseMultiColumnCodeTable.java:74)
       at com.topsoft.common.codetable.multicolumn.BaseMultiColumnCodeTable.get
      DataMapValues(BaseMultiColumnCodeTable.java:92)
       at com.topnet.tais.domain.common.codetable.SampleItemCodeTableImpl.getSa
      mpleItemCodeByCode(SampleItemCodeTableImpl.java:22)
       at com.topnet.tais.web.reg.action.TaxKindRegisterAction.findSubjectRules
      (TaxKindRegisterAction.java:491)
      


      so I update the jars to 2.2.0,but an new Exception occured. like this :
      rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheAdapter' defined in file [E:\projects\liuyuxiao_TopSOF_V1.1\SOF\bin\beans-common.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.topsoft.common.cacheadapt.CacheAdapterJbossImpl]: Constructor threw exception; nested exception is java.lang.NullPointerException
      Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.topsoft.common.cacheadapt.CacheAdapterJbossImpl]: Constructor threw exception; nested exception is java.lang.NullPointerException
      Caused by: java.lang.NullPointerException
       at org.jboss.cache.interceptors.MarshalledValueInterceptor.wrapMap(MarshalledValueInterceptor.java:169)
       at org.jboss.cache.interceptors.MarshalledValueInterceptor.visitPutDataMapCommand(MarshalledValueInterceptor.java:48)
       at org.jboss.cache.commands.write.PutDataMapCommand.acceptVisitor(PutDataMapCommand.java:89)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:266)
       at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:253)
       at org.jboss.cache.commands.AbstractVisitor.visitPutDataMapCommand(AbstractVisitor.java:39)
       at org.jboss.cache.commands.write.PutDataMapCommand.acceptVisitor(PutDataMapCommand.java:89)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.CacheMgmtInterceptor.visitPutDataMapCommand(CacheMgmtInterceptor.java:95)
       at org.jboss.cache.commands.write.PutDataMapCommand.acceptVisitor(PutDataMapCommand.java:89)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:155)
       at org.jboss.cache.interceptors.InvocationContextInterceptor.visitPutDataMapCommand(InvocationContextInterceptor.java:48)
       at org.jboss.cache.commands.write.PutDataMapCommand.acceptVisitor(PutDataMapCommand.java:89)
       at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:215)
       at org.jboss.cache.invocation.CacheInvocationDelegate.put(CacheInvocationDelegate.java:447)
       at org.jboss.cache.invocation.NodeInvocationDelegate.addChild(NodeInvocationDelegate.java:306)
       at com.topsoft.common.cache.TopCacheImpl.instance(TopCacheImpl.java:46)
       at com.topsoft.common.cache.TopCacheImpl.<init>(TopCacheImpl.java:39)
       at com.topsoft.common.cacheadapt.CacheAdapterJbossImpl.<init>(CacheAdapterJbossImpl.java:13)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       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:759)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:724)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:387)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:881)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:829)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:424)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
       at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
       at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
       at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
       at com.topsoft.common.ContextHelper.getXmlContext(ContextHelper.java:22)
       at com.topsoft.common.codetable.StoreCodeTableTemplateTest.setUp(StoreCodeTableTemplateTest.java:24)
       at junit.framework.TestCase.runBare(TestCase.java:125)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      





      what the matter? give me a suggest....

        • 1. Re: what should I do
          guazi

          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.bdbje.BdbjeCacheLoader
           </class>
           <properties>location=./jbossCacheTemp/</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>
          


          • 2. Re: what should I do
            manik

            Are you sure that is the cfg you used? You have UseLazyDeserialization set to false, yet in your stack trace you have a MarshalledValueInterceptor. MarshalledValueInterceptors are only added if UseLazyDeserialization is true.

            • 3. Re: what should I do
              guazi

              Thanks. I'm sorry that I made a mistake. I changed the "UseLazyDeserialization" to false ,and it works well. But when I used jbosscache 2.1.1 , there was no exception. what's the matter?