You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/12/07 20:31:14 UTC
Re: java.io.NotSerializableException: Serialization problems running
Struts on Weblogic
"Punyansky, Alex" wrote:
> Hi,
>
> We created an application based on struts and are trying to deploy it on
> Weblogic 6.0 beta2. Looks like Weblogic doesn't look at <distributable /> in
> web.xml and requires all classes that can be used as context attributes to
> be serializable. We tried to make MessageResources and ErrorMessages classes
> implement Serializable but we still get the following Exception:
>
Also, the Serializable restriction when you specify <distributable/> relates to
*session* attributes, not *context* attributes. Requiring context attributes to
be serializable is a platform-specific restriction that WebLogic is imposing. I
will look into the issues for the Struts-related classes, but it looks to me
like the JDK's ResourceBundle class is not Serializable :-(.
NOTE: The current design of the Struts example application means it would not
work correctly in a real distributable environment anyway, because the
pseudo-database is stored in memory as a servlet context attribute.
Craig McClanahan
Re: java.io.NotSerializableException: Serialization problems running Struts on Weblogic
Posted by Laird Nelson <lj...@unix.amherst.edu>.
Any way you could force use of PropertyResourceBundle instead, and then
write a simple "save this to a java.util.Properties" converter? Then
MessageResources (or whatever the name of the class is) could have an
easy writeExternal() method that effectively makes it serializable.
Product of two seconds of thought, so #include <appropriate_warnings.h>.
Cheers,
Laird
----- Original Message -----
From: "Craig R. McClanahan" <Cr...@eng.sun.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, December 07, 2000 2:31 PM
Subject: Re: java.io.NotSerializableException: Serialization problems
running Struts on Weblogic
> "Punyansky, Alex" wrote:
>
> > Hi,
> >
> > We created an application based on struts and are trying to deploy
it on
> > Weblogic 6.0 beta2. Looks like Weblogic doesn't look at
<distributable /> in
> > web.xml and requires all classes that can be used as context
attributes to
> > be serializable. We tried to make MessageResources and ErrorMessages
classes
> > implement Serializable but we still get the following Exception:
> >
>
> Also, the Serializable restriction when you specify <distributable/>
relates to
> *session* attributes, not *context* attributes. Requiring context
attributes to
> be serializable is a platform-specific restriction that WebLogic is
imposing. I
> will look into the issues for the Struts-related classes, but it looks
to me
> like the JDK's ResourceBundle class is not Serializable :-(.
>
> NOTE: The current design of the Struts example application means it
would not
> work correctly in a real distributable environment anyway, because the
> pseudo-database is stored in memory as a servlet context attribute.
>
> Craig McClanahan
>
>
>
Re: java.io.NotSerializableException: Serialization problems running
Struts on Weblogic
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Ray Power wrote:
> > Also, the Serializable restriction when you specify
> > <distributable/> relates to
> > *session* attributes, not *context* attributes. Requiring
> > context attributes to
> > be serializable is a platform-specific restriction that WebLogic
>
> Craig,
>
> Just to clarify; when you mention " *context* attributes ", you are refering
> to application wide attributes?
>
Yes. To be specific, by "context attributes" I mean servlet context attributes
that are accessed from a servlet like this:
getServletContext().getAttribute("foo", myObject);
or from a JSP page like this:
<jsp:useBean id="xxx" class="yyy" scope="application" ... />
This contrasts with session attributes -- those you attach to your HttpSession.
>
> Ray
Craig
RE: java.io.NotSerializableException: Serialization problems running Struts on Weblogic
Posted by Ray Power <rp...@bigfoot.com>.
> Also, the Serializable restriction when you specify
> <distributable/> relates to
> *session* attributes, not *context* attributes. Requiring
> context attributes to
> be serializable is a platform-specific restriction that WebLogic
Craig,
Just to clarify; when you mention " *context* attributes ", you are refering
to application wide attributes?
Ray