You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sebastien Arbogast <se...@gmail.com> on 2005/04/29 16:55:57 UTC

NotSerializableException ?

Hi,

When I shut down my tomcat server with my cocoon application (schaman)
inside, I get a mysterious NotSerializableException which seems to be
linked to both Spring and Flow (see
org.mozilla.javascript.NativeJavaObject.writeExternal(NativeJavaObject.java:993))
:

INFO: Retrait de l'application web pour le chemin de contexte /schaman
- Impossible de sérialiser l'attribut de session FOM JavaScript GLOBAL
SCOPE/file:/C:/dev/pfe/schaman/target/webapp/admin/sitemap.xmap:53:37
pour la session D65F51D70184DCB7004DD1872DE23FAD
java.io.NotSerializableException:
org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(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.defaultWriteFields(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.writeArray(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(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.defaultWriteFields(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.defaultWriteFields(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.mozilla.javascript.NativeJavaObject.writeExternal(NativeJavaObject.java:993)
	at java.io.ObjectOutputStream.writeExternalData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(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.writeArray(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(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.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1415)
	at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:902)
	at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:539)
	at org.apache.catalina.session.StandardManager.unload(StandardManager.java:485)
	at org.apache.catalina.session.StandardManager.stop(StandardManager.java:687)
	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4496)
	at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:952)
	at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.java:670)
	at org.apache.catalina.core.StandardHost.remove(StandardHost.java:946)
	at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1028)
	at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1005)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:351)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1123)
	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1135)
	at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:483)
	at org.apache.catalina.core.StandardService.stop(StandardService.java:542)
	at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2347)
	at org.apache.catalina.startup.Catalina.stop(Catalina.java:605)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:580)
	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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

Any idea of what can be the cause of that ?

Thx in advance.

-- 
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: NotSerializableException ?

Posted by Jorg Heymans <jh...@domek.be>.
Sebastien Arbogast wrote:

>>Upon container shutdown, Spring (or maybe the container itself) tries to
>>be a good citizen and serialize the session to disk. Now there are some
>>components/classes in flowscript that are not serializable, hence the
>>session serialization fails and you get this stacktrace.
> 
> 
> And your guess is good. I think my problem comes from a ServiceLocator
> singleton I use to access my Spring services. It's not a class of my
> own, it's automatically generated by AndroMDA and it has a shutdown()
> method which releases resources. It should release that
> NotSerializable transaction manager but the problem is how can I
> automatically call this method after each request or at least just
> before my application is shut down ?
> 

Servlet event listeners [1] are probably what you're looking for. But 
i'm sure there is a "spring" way of doing this as well.


Jorg

[1] http://www.onjava.com/pub/a/onjava/2001/04/12/listeners.html


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: NotSerializableException ?

Posted by Sebastien Arbogast <se...@gmail.com>.
> Upon container shutdown, Spring (or maybe the container itself) tries to
> be a good citizen and serialize the session to disk. Now there are some
> components/classes in flowscript that are not serializable, hence the
> session serialization fails and you get this stacktrace.

And your guess is good. I think my problem comes from a ServiceLocator
singleton I use to access my Spring services. It's not a class of my
own, it's automatically generated by AndroMDA and it has a shutdown()
method which releases resources. It should release that
NotSerializable transaction manager but the problem is how can I
automatically call this method after each request or at least just
before my application is shut down ?

-- 
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: NotSerializableException ?

Posted by Jorg Heymans <jh...@domek.be>.
Not sure but here's my best guess:

Upon container shutdown, Spring (or maybe the container itself) tries to 
be a good citizen and serialize the session to disk. Now there are some 
components/classes in flowscript that are not serializable, hence the 
session serialization fails and you get this stacktrace.


Jorg

Sebastien Arbogast wrote:
> Hi,
> 
> When I shut down my tomcat server with my cocoon application (schaman)
> inside, I get a mysterious NotSerializableException which seems to be
> linked to both Spring and Flow (see
> org.mozilla.javascript.NativeJavaObject.writeExternal(NativeJavaObject.java:993))
> :
> 
> INFO: Retrait de l'application web pour le chemin de contexte /schaman
> - Impossible de sérialiser l'attribut de session FOM JavaScript GLOBAL
> SCOPE/file:/C:/dev/pfe/schaman/target/webapp/admin/sitemap.xmap:53:37
> pour la session D65F51D70184DCB7004DD1872DE23FAD
> java.io.NotSerializableException:
> org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
> 	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> 	at java.io.ObjectOutputStream.defaultWriteFields(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.defaultWriteFields(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.writeArray(Unknown Source)
> 	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> 	at java.io.ObjectOutputStream.defaultWriteFields(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.defaultWriteFields(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.defaultWriteFields(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.mozilla.javascript.NativeJavaObject.writeExternal(NativeJavaObject.java:993)
> 	at java.io.ObjectOutputStream.writeExternalData(Unknown Source)
> 	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> 	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> 	at java.io.ObjectOutputStream.defaultWriteFields(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.writeArray(Unknown Source)
> 	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> 	at java.io.ObjectOutputStream.defaultWriteFields(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.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1415)
> 	at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:902)
> 	at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:539)
> 	at org.apache.catalina.session.StandardManager.unload(StandardManager.java:485)
> 	at org.apache.catalina.session.StandardManager.stop(StandardManager.java:687)
> 	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4496)
> 	at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:952)
> 	at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.java:670)
> 	at org.apache.catalina.core.StandardHost.remove(StandardHost.java:946)
> 	at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1028)
> 	at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1005)
> 	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:351)
> 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> 	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1123)
> 	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1135)
> 	at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:483)
> 	at org.apache.catalina.core.StandardService.stop(StandardService.java:542)
> 	at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2347)
> 	at org.apache.catalina.startup.Catalina.stop(Catalina.java:605)
> 	at org.apache.catalina.startup.Catalina.start(Catalina.java:580)
> 	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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
> 	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
> 
> Any idea of what can be the cause of that ?
> 
> Thx in advance.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org