You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alec Bickerton <al...@minick.ch> on 2007/12/10 10:56:45 UTC

Cocoon and clustering

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I'm using cocoon 2.1.9 and am seeing some unusual behaviour when tomcat
shuts down.

I see a NotSerializableException thrown regarding CocoonComponentManager
and SessionContext[1]. To my knowledge, the application doest not store
any session contect in the session.

The cocoon application only uses pipelines and a few actions and
generators. We're not using Flowscript or Javaflow so was not expecting
to see this issue.

Does anyone know what likely to be causing this ?

Best,
Alec Bickerton

[1]
10:51:56 org.apache.catalina.session.StandardSession writeObject
WARNUNG: Cannot serialize session attribute
org.apache.cocoon.webapps.session.context.SessionContext for session
CDB47D39E1397EC6E6E09CFDC75E33DD
java.io.NotSerializableException:
org.apache.cocoon.components.CocoonComponentManager
	at hava.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
	at java.util.HashMap.writeObject(HashMap.java:1001)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	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:1461)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHXQ1dI8FdkhJ0AeIRAiHTAJ49OkJ27e5RBQC0o35P+lZAmnduqACeNUux
ayA13+dHIZLtiNsjKCHdOkk=
=OD/I
-----END PGP SIGNATURE-----

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


Re: Cocoon and clustering

Posted by Alec Bickerton <al...@minick.ch>.
Carsten Ziegeler wrote:
> Alec Bickerton wrote:
>> Hello,
>>
>> I'm using cocoon 2.1.9 and am seeing some unusual behaviour when tomcat
>> shuts down.
>>
>> I see a NotSerializableException thrown regarding CocoonComponentManager
>> and SessionContext[1]. To my knowledge, the application doest not store
>> any session contect in the session.
>>
>> The cocoon application only uses pipelines and a few actions and
>> generators. We're not using Flowscript or Javaflow so was not expecting
>> to see this issue.
>>
> Are you using the session or the authentication framework? Or the portal
> block?

We use the session from within some generators and actions. We're
certainly not using the authentication framework, I think the portlet
block was built when cocoon was compiled.

Unfortunately, this is an inherited application, so I'm still finding
some things out.

Regards,
Alec


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


Re: Cocoon and clustering

Posted by Carsten Ziegeler <cz...@apache.org>.
Alec Bickerton wrote:
> Hello,
> 
> I'm using cocoon 2.1.9 and am seeing some unusual behaviour when tomcat
> shuts down.
> 
> I see a NotSerializableException thrown regarding CocoonComponentManager
> and SessionContext[1]. To my knowledge, the application doest not store
> any session contect in the session.
> 
> The cocoon application only uses pipelines and a few actions and
> generators. We're not using Flowscript or Javaflow so was not expecting
> to see this issue.
> 
> Does anyone know what likely to be causing this ?
> 
Are you using the session or the authentication framework? Or the portal
block?

Carsten
--
Carsten Ziegeler
cziegeler@apache.org

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


Re: Cocoon and clustering

Posted by Alec Bickerton <al...@minick.ch>.
Carsten Ziegeler wrote:
> Alec Bickerton wrote:
>> Having spent most of today going through a mountain of .xsl, I have
>> found the cause. It appears that if a transformation does this...
>>
>>  <session:createcontext name="mysession"/>
>>  <session:setxml context="mysession" path="/sessionua">
>>      ....
>>  </session:setxml>
>>
>> Then the session context hangs around and causes the Not serializable
>> exception.
>>
>> Am I missing something?
>>
>> Does any mechanism exist to ensure this is removed at the end of the
>> pipeline.
>>
> Ok, by this you create a *session* context, so the scope/lifetime of
> this context is the session. Therefore it's not destroyed at the end of
> the request.

Is it possible to create a context that explicitly has a scope of the
request ?

> Depending on your application and what you're doing there is the
> temporary context (lifetime is a single request). So changing the first
> line to
> 
> <session:createcontext name="temporary"/>

Thanks, that seems to have done the trick. Although I still need to do
some more thorough testing, changing to use the temporary context, has
made the NotSerializableException issue disappear.

All the best,
Alec

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


Re: Cocoon and clustering

Posted by Carsten Ziegeler <cz...@apache.org>.
Alec Bickerton wrote:
> 
> Having spent most of today going through a mountain of .xsl, I have
> found the cause. It appears that if a transformation does this...
> 
>  <session:createcontext name="mysession"/>
>  <session:setxml context="mysession" path="/sessionua">
>      ....
>  </session:setxml>
> 
> Then the session context hangs around and causes the Not serializable
> exception.
> 
> Am I missing something?
> 
> Does any mechanism exist to ensure this is removed at the end of the
> pipeline.
> 
Ok, by this you create a *session* context, so the scope/lifetime of
this context is the session. Therefore it's not destroyed at the end of
the request.
Depending on your application and what you're doing there is the
temporary context (lifetime is a single request). So changing the first
line to

<session:createcontext name="temporary"/>

might solve your problem.

HTH
Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

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


Re: Cocoon and clustering

Posted by Alec Bickerton <al...@minick.ch>.
Alec Bickerton wrote:
> Hello,
> 
> I'm using cocoon 2.1.9 and am seeing some unusual behaviour when tomcat
> shuts down.
> 
> I see a NotSerializableException thrown regarding CocoonComponentManager
> and SessionContext[1]. To my knowledge, the application doest not store
> any session contect in the session.
> 
> The cocoon application only uses pipelines and a few actions and
> generators. We're not using Flowscript or Javaflow so was not expecting
> to see this issue.
> 
> Does anyone know what likely to be causing this ?

Having spent most of today going through a mountain of .xsl, I have
found the cause. It appears that if a transformation does this...

 <session:createcontext name="mysession"/>
 <session:setxml context="mysession" path="/sessionua">
     ....
 </session:setxml>

Then the session context hangs around and causes the Not serializable
exception.

Am I missing something?

Does any mechanism exist to ensure this is removed at the end of the
pipeline.

Alec,

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


Re: Cocoon and clustering

Posted by Alec Bickerton <al...@minick.ch>.
Michael Wechner wrote:
> Alec Bickerton wrote:
> 
> Hello,
> 
> I'm using cocoon 2.1.9 and am seeing some unusual behaviour when tomcat
> shuts down.
> 
> I see a NotSerializableException thrown regarding CocoonComponentManager
> and SessionContext[1]. To my knowledge, the application doest not store
> any session contect in the session.
> 
> The cocoon application only uses pipelines and a few actions and
> generators. We're not using Flowscript or Javaflow so was not expecting
> to see this issue.
>  
> 
> 
>> AFAIK "Flow" does not support serialization resp. clustering, although
>> IIRC there is a Wiki page which is refering to this issue.

Yes, I read that page when I first encountered this. That's why I
specified that we are not using it.

I read in the mailing list archives[1] that using a limited amount of
functionality would be unlikely to cause such an issue.

Best,
Alec

[1] Sorry, but I have lost the link to the original message.

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


Re: Cocoon and clustering

Posted by Michael Wechner <mi...@wyona.com>.
Alec Bickerton wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hello,
>
>I'm using cocoon 2.1.9 and am seeing some unusual behaviour when tomcat
>shuts down.
>
>I see a NotSerializableException thrown regarding CocoonComponentManager
>and SessionContext[1]. To my knowledge, the application doest not store
>any session contect in the session.
>
>The cocoon application only uses pipelines and a few actions and
>generators. We're not using Flowscript or Javaflow so was not expecting
>to see this issue.
>  
>

AFAIK "Flow" does not support serialization resp. clustering, although 
IIRC there is a Wiki page which is refering to this issue.

Cheers

Michael

>Does anyone know what likely to be causing this ?
>
>Best,
>Alec Bickerton
>
>[1]
>10:51:56 org.apache.catalina.session.StandardSession writeObject
>WARNUNG: Cannot serialize session attribute
>org.apache.cocoon.webapps.session.context.SessionContext for session
>CDB47D39E1397EC6E6E09CFDC75E33DD
>java.io.NotSerializableException:
>org.apache.cocoon.components.CocoonComponentManager
>	at hava.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
>	at
>java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
>	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
>	at
>java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
>	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
>	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
>	at java.util.HashMap.writeObject(HashMap.java:1001)
>	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>	at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>	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:1461)
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.7 (MingW32)
>
>iD8DBQFHXQ1dI8FdkhJ0AeIRAiHTAJ49OkJ27e5RBQC0o35P+lZAmnduqACeNUux
>ayA13+dHIZLtiNsjKCHdOkk=
>=OD/I
>-----END PGP SIGNATURE-----
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management - Yanel, Yulup
http://www.wyona.com
michael.wechner@wyona.com, michi@apache.org
+41 44 272 91 61


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