6 Replies Latest reply on Sep 23, 2010 1:06 PM by Galder Zamarreño

    help upgrading from 1.2.1 to 3.2.5 needed

    Dirk Mallon Newbie

      Hallo !

       

      Got some Problems with upgrading our Caching.We want to use Hibernate 3.5.2 and JBossCache 3.2.5.

       

      We got two Tomcats on different machines. Everyone has cache and they syncronize via JGroups/udp.

       

      It is my task to upgrade now.

       

      At Start i see that hibernate(withc3p0) starts and cache seems to start too because I see this line on console and its similar

      to the former version:

       

      GMS: address is 168.21.1.120:62174 (cluster=JBossCache-cluster)

       

       

      In the following trace a CommandAwareRpcDispatcher had an error

       

      6040 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
      6040 [main] INFO org.hibernate.cache.UpdateTimestampsCache - starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
      6041 [main] INFO org.hibernate.cache.StandardQueryCache - starting query cache at region: org.hibernate.cache.StandardQueryCache
      2010-05-28 09:49:26,225 (main                      CommandAwareRpcDispatcher.java:387 ) ERROR java.lang.NullPointerException

       

      but Hibernate can get  a List of entities from the Database.

       

      In my next lines, I instanciate a new entity start saving via Hibernate.

       

      But now it crashes with this:

       

      2010-05-28 09:49:26,397 (main                      CommandAwareRpcDispatcher.java:387 ) ERROR java.lang.NullPointerException
      6510 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
      org.hibernate.cache.CacheException: org.hibernate.cache.CacheException: java.lang.RuntimeException: Failure to marshal argument(s)

       

       

       

      Can anyone give me a hint, where to look to solve the problem?

       

       

      thx Dirk

        • 1. Re: help upgrading from 1.2.1 to 3.2.5 needed
          Galder Zamarreño Master

          Your comment shows an issue with a failure marshalling something. So, probably what you're trying to store is not Serializable or Externalizable.

          • 2. Re: help upgrading from 1.2.1 to 3.2.5 needed
            Dirk Mallon Newbie

            Hallo Galder and thx for reply!

             

            I was in Holidays so  did not answer.

             

            i describe the situation more detailed:

             

            productive system:

            I run two Tomcats running on different servers with same webApp using hibernate on one DB.

            JbossCache is second-level-cache for hibernate.

            Jbosscache has no connection to DB.

             

            testing:

            to test the new jars and config i made to testprojects in eclipse similar to the productive system.

            I load and save some hibernate-entities.

            Got the same error as described in initial post.(full Trace at end of msg)

             

            then i switched off serialization in treecache.xml and the error  disappeared.

             

             

            1) considering the scenario i  described above:

             

            What configurations in treecache.xml are necessary to  match our needs(two cache-instances syncronizing permanently after  changes in one of them). Do we need serialization?

             

             

             

            trace-----------------

            (main                      CommandAwareRpcDispatcher.java:387 ) ERROR java.lang.NullPointerException
            2010-06-17 16:06:54,231 (main                      CommandAwareRpcDispatcher.java:387 ) ERROR java.lang.NullPointerException
            2010-06-17 16:06:54,231 (main                  AbstractFlushingEventListener.java:324 ) ERROR Could not synchronize database state with session
            org.hibernate.cache.CacheException: org.hibernate.cache.CacheException: java.lang.RuntimeException: Failure to marshal argument(s)
                at org.hibernate.cache.jbc.timestamp.TimestampsRegionImpl.put(TimestampsRegionImpl.java:138)
                at org.hibernate.cache.UpdateTimestampsCache.preinvalidate(UpdateTimestampsCache.java:70)
                at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:275)
                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:260)
                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:179)
                at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
                at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
                at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
                at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)
                at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
                at cas.cache.test.AbstractService.save(AbstractService.java:202)
                at cas.cache.test.Starter.createSubs(Starter.java:45)
                at cas.cache.test.Starter.run(Starter.java:30)
                at cas.cache.test.Starter.main(Starter.java:21)
            Caused by: org.hibernate.cache.CacheException: java.lang.RuntimeException: Failure to marshal argument(s)
                at org.hibernate.cache.jbc.util.CacheHelper.put(CacheHelper.java:216)
                at org.hibernate.cache.jbc.timestamp.TimestampsRegionImpl.put(TimestampsRegionImpl.java:136)
                ... 13 more
            Caused by: java.lang.RuntimeException: Failure to marshal argument(s)
                at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:388)
                at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:355)
                at org.jboss.cache.util.concurrent.WithinThreadExecutor.submit(WithinThreadExecutor.java:82)
                at org.jboss.cache.marshall.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:210)
                at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:744)
                at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:712)
                at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:717)
                at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:161)
                at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:135)
                at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:107)
                at org.jboss.cache.interceptors.ReplicationInterceptor.handleCrudMethod(ReplicationInterceptor.java:160)
                at org.jboss.cache.interceptors.ReplicationInterceptor.visitPutKeyValueCommand(ReplicationInterceptor.java:107)
                at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
                at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
                at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
                at org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)
                at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
                at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
                at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:301)
                at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:283)
                at org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)
                at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
                at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
                at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)
                at org.jboss.cache.interceptors.InvocationContextInterceptor.visitPutKeyValueCommand(InvocationContextInterceptor.java:82)
                at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
                at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)
                at org.jboss.cache.invocation.CacheInvocationDelegate.put(CacheInvocationDelegate.java:555)
                at org.hibernate.cache.jbc.util.CacheHelper.put(CacheHelper.java:214)
                ... 14 more
            Caused by: java.lang.NullPointerException
                at org.jboss.cache.marshall.VersionAwareMarshaller.objectToObjectStream(VersionAwareMarshaller.java:342)
                at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:183)
                at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:52)
                at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:383)
                ... 42 more

            trace-----------------

            • 3. Re: help upgrading from 1.2.1 to 3.2.5 needed
              Dirk Mallon Newbie

              Hallo again!

               

              I debug the src's and the NullPointerEx is because the defaultMarshaller in VersionAwareMarshaller is null.

               


              Caused by: java.lang.NullPointerException
                  at org.jboss.cache.marshall.VersionAwareMarshaller.objectToObjectStream(VersionAwareMarshaller.java:342)
                  at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:183)
                  at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:52)

               

               

              Any ideas why?

               

              thx dirk

              • 4. Re: help upgrading from 1.2.1 to 3.2.5 needed
                Manik Surtani Master

                If you are using Hibernate 3.5.x, you should consider using Infinispan as a 2nd level cache instead.

                • 5. Re: help upgrading from 1.2.1 to 3.2.5 needed
                  Marilen Corciovei Newbie

                  I have a very similar problem. Did you found a solution?