Craig,

This is a copy of the thread on weblogic.developer.interest.60beta.servlet
 " Re: Yet another problem with struts and Weblogic 6.0 beta "



====================================================================

Mark Spotswood <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> This looks similar to an issue that came up on the JSP newsgroup recently.
Below is the
> response I wrote there. Hope it helps.
> --
> mark
>
>
> In order to support reloading of jsps/classes in a webapp, we need to
> create a new classloader.  All stateful objects loaded from the old
> classloader (such as things put into the session) need to be reloaded
> in the new classloader.  We try to preserve the state of the objects
> using serialization.  If the object isn't serializable, you are out of
> luck, and the object is lost.  The only other alternative in the case
> where we're trying to support reloading is to allow a
> classcastexception to occur.
>
> The only alternative in the current product is to turn off reloading,
> setting jsp pageCheckSecs=-1 and ServletReloadCheckSecs=-1.
>
> There is a thread on the servlet 2.3 mailing list where it looks like
> the servlet 2.3 spec will have words to the effect that things put
> into the session should be serializable if you want class reloading to
> work in the container.
>
> We suspect that this will be a fairly common problem, so we are
> trying to find ways to avoid this in our implementation such as
> using a classloader per jsp and handling this specific exception.
> Unfortunately, this will probably not make it before GA.
>
> The following is from the servlet 2.3 spec
> -------------------------------------------------------------------
> "In order to allow sessions to persist across class reloading within
> the container, it is highly advised that you should implement the
> Serializable interface. Otherwise, you risk the strong chance that the
> objects within your session will not exist after the classloader has
> been reloaded."
> --------------------------------------------------------------------
>
> I've entered CR039368 to track this issue.
>
> --
> mark
>
>
>
> Matt Heaton wrote:
>
> > After many unsuccessful attempts at getting Struts to work on Weblogic
5.1, I decided with give it a try on Weblogic 6.0 Beta 2
> >
> > Everything seems to be deploying correct except for I get the following
error (which of course breaks everything):
> >
> > <Nov 30, 2000 1:19:37 PM PST> <Error> <HTTP>
<[WebAppServletContext(6802820,struts-example)] Cou
> > ld 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.bean.MessageTag.doStartTag(MessageTag.java:230)
> >         at jsp_servlet._index._jspService(_index.java:105)
> >         at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> >         at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
> >         at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:244)
> >         at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.jav
> > a: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)
> > >
> >
> > It appears that Weblogic requires any object that you use as a context
attribute on a JSP page must be serializable.  I went through some of the
Struts source and it's trying to use objects which aren't serializable as
JSP page context attributes.  This looks like it may be a shortcoming in the
JSP spec because it makes sense that to support to failover of sessions you
would need to be able to serialize the attributes since a the attributes of
a PageContext may have the scope of an entire session.
> >
> > -Matt
>

============================================================================
======





> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 08, 2000 2:39 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Struts+Weblogic=Problems. Changes to struts?
>
>
> Matthew Heaton wrote:
>
> > They told me that the spec will disallow it but I have no idea
> if that is
> > factual or not.  It could just be their interpretation of the
> spec, from the
> > snipets I've seen it definetly says you shouldn't put Non Serializable
> > objects into the session but isn't very clear about putting
> them into the
> > PageContext under different scopes.
> >
>
> Do you have an email address at WebLogic that I can follow up with?
>
> >
> > -Matt
> >
>
> Craig
>
>

Reply via email to