1 Reply Latest reply: Oct 13, 2011 3:46 PM by Vítor Corrêa RSS

NotSerializableException on spring class: InstantiationModelAwarePointcutAdvisorImpl

chiara80 Newbie

Hi,

I have a problem on clistering with an application based on spring.

When two instances of my application are running, I can navigate through the site correctly except when I try to do some operations that involve the change of some session attributes...

 

The error is on a spring class and I've tried to set this class as Serializable, but the error then is on another class and then another one...

 

I have this stacktrace:

 

2011-09-12 14:27:07,717 WARN  [org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.CacheListener] (Incoming-20,10.6.212.26:56531) Possible concurrency problem: Replicated version id 3 is less than or equal to in-memory version for session jxVvAXYD54p6tNppa9mPBQ__

2011-09-12 14:27:23,747 WARN  [org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.CacheListener] (Incoming-2,10.6.212.26:56531) Possible concurrency problem: Replicated version id 4 is less than or equal to in-memory version for session jxVvAXYD54p6tNppa9mPBQ__

2011-09-12 14:34:27,376 ERROR [org.jboss.cache.marshall.CacheMarshaller300] (ajp-10.6.212.26-8009-4) Error while marshalling object: ReplicateCommand{cmds=PrepareCommand{globalTransaction=GlobalTransaction:<10.6.212.26:56531>:10, modifications=[PutDataMapCommand{fqn=/JSESSION/PST_localhost/jxVvAXYD54p6tNppa9mPBQ__, dataVersion=null, data={currentContentOnSession=org.jboss.ha.framework.server.SimpleCachableMarshalledValue{raw=com.agiletec.plugins.jacms.aps.system.services.content.model.Content@1fccc2efserialized=false}}, globalTransaction=GlobalTransaction:<10.6.212.26:56531>:10, erase=false}, PutDataMapCommand{fqn=/JSESSION/PST_localhost/jxVvAXYD54p6tNppa9mPBQ__, dataVersion=null, data={0=12, 1=1315830864382}, globalTransaction=null, erase=false}], localAddress=10.6.212.26:56531, onePhaseCommit=true}}

java.io.NotSerializableException: org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)

    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)

    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

    at java.util.ArrayList.writeObject(ArrayList.java:570)

    at sun.reflect.GeneratedMethodAccessor338.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

    at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.serialize(SimpleCachableMarshalledValue.java:271)

    at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.writeExternal(SimpleCachableMarshalledValue.java:252)

    at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)

    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)

    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:460)

    at org.jboss.cache.marshall.CacheMarshaller300.marshallObject(CacheMarshaller300.java:47)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallMap(CacheMarshaller200.java:569)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:370)

    at org.jboss.cache.marshall.CacheMarshaller300.marshallObject(CacheMarshaller300.java:47)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallCommand(CacheMarshaller200.java:519)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:314)

    at org.jboss.cache.marshall.CacheMarshaller300.marshallObject(CacheMarshaller300.java:47)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallCollection(CacheMarshaller200.java:555)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:365)

    at org.jboss.cache.marshall.CacheMarshaller300.marshallObject(CacheMarshaller300.java:47)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallCommand(CacheMarshaller200.java:519)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:314)

    at org.jboss.cache.marshall.CacheMarshaller300.marshallObject(CacheMarshaller300.java:47)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallCommand(CacheMarshaller200.java:519)

    at org.jboss.cache.marshall.CacheMarshaller200.marshallObject(CacheMarshaller200.java:314)

    at org.jboss.cache.marshall.CacheMarshaller300.marshallObject(CacheMarshaller300.java:47)

    at org.jboss.cache.marshall.CacheMarshaller200.objectToObjectStream(CacheMarshaller200.java:191)

    at org.jboss.cache.marshall.CacheMarshaller200.objectToObjectStream(CacheMarshaller200.java:136)

    at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:182)

    at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:52)

    at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:369)

    at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:341)

    at org.jboss.cache.util.concurrent.WithinThreadExecutor.submit(WithinThreadExecutor.java:82)

    at org.jboss.cache.marshall.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:206)

    at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:748)

    at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:716)

    at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:721)

    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.runPreparePhase(ReplicationInterceptor.java:192)

    at org.jboss.cache.interceptors.ReplicationInterceptor.visitPrepareCommand(ReplicationInterceptor.java:72)

    at org.jboss.cache.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:68)

    at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)

    at org.jboss.cache.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:50)

    at org.jboss.cache.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:68)

    at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)

    at org.jboss.cache.interceptors.TxInterceptor.handleCommitRollback(TxInterceptor.java:539)

    at org.jboss.cache.interceptors.TxInterceptor.runCommitPhase(TxInterceptor.java:572)

    at org.jboss.cache.interceptors.TxInterceptor$RemoteSynchronizationHandler.afterCompletion(TxInterceptor.java:969)

    at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.afterCompletion(TxInterceptor.java:1156)

    at org.jboss.cache.interceptors.OrderedSynchronizationHandler.afterCompletion(OrderedSynchronizationHandler.java:92)

    at org.jboss.cache.transaction.DummyTransaction.notifyAfterCompletion(DummyTransaction.java:307)

    at org.jboss.cache.transaction.DummyTransaction.commit(DummyTransaction.java:96)

    at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:109)

    at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.BatchingManagerImpl.endBatch(BatchingManagerImpl.java:70)

    at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1967)

    at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:309)

    at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:51)

    at org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:147)

    at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)

    at org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)

    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)

    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

    at java.lang.Thread.run(Thread.java:662)

2011-09-12 14:34:27,377 ERROR [org.jboss.cache.marshall.CommandAwareRpcDispatcher] (ajp-10.6.212.26-8009-4) java.io.NotSerializableException: org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl

2011-09-12 14:34:27,378 WARN  [org.jboss.cache.interceptors.TxInterceptor] (ajp-10.6.212.26-8009-4) Commit failed.  Clearing stale locks.

 

 

 

Have somene had my problem?

 

Thanks

  • 1. Re: NotSerializableException on spring class: InstantiationModelAwarePointcutAdvisorImpl
    Vítor Corrêa Newbie

    Hi

     

    This happens because jboss needs to serialize all httpSession atributes to replicate over the cluster instances. So all classes on your httpSession

    should implements serializable. As you said "it happens when you try to change some sessions attributes", take a look on those classes to check if

    there is any dependency ( and subdependencies ) that not implements serializable. How is the serialnumberID is beeing generated ? 1L?

    Please reply this thread with your changes.

    Thanks