Re: java.io.NotSerializableException: Serialization problems running Struts on Weblogic

2000-12-08 Thread Laird Nelson

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 .

Cheers,
Laird

- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
 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 
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

2000-12-07 Thread Craig R. McClanahan

Ray Power wrote:

> > Also, the Serializable restriction when you specify
> >  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:



This contrasts with session attributes -- those you attach to your HttpSession.

>
> Ray

Craig





RE: java.io.NotSerializableException: Serialization problems running Struts on Weblogic

2000-12-07 Thread Ray Power

> Also, the Serializable restriction when you specify
>  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




Re: java.io.NotSerializableException: Serialization problems running Struts on Weblogic

2000-12-07 Thread Craig R. McClanahan

"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  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  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





java.io.NotSerializableException: Serialization problems running Struts on Weblogic

2000-12-07 Thread Punyansky, Alex

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  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:

 
 <> <101002> <[WebAppServletContext(5383266,trsitev11)] Could not
deserialize context attribute> 
java.io.NotSerializableException: java.util.PropertyResourceBundle
at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at
java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at
weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:7
1)
at
weblogic.servlet.internal.WebAppServletContext.getAttribute(WebAppServletCon
text.java:207)
at
weblogic.servlet.jsp.PageContextImpl.getAttribute(PageContextImpl.java:164)
at
org.apache.struts.taglib.form.ErrorsTag.doStartTag(ErrorsTag.java:180)
at jsp_servlet._login._jspService(_login.java:88)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:149)
at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1210)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1075)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:387)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:149)
at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1210)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1075)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:387)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1107)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1482)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Does anyone know of any way to fix this problem?


Thanks

Alex