struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colin Sampaleanu <co...@Bspark.com>
Subject RE: problem with Weblogic 5.1
Date Fri, 01 Sep 2000 03:12:48 GMT
You are actaully getting this particular message because you are hitting a
struts-dependent JSP file before the struts action servlet has been
initialized. The ActionServlet has not been initialized because WebLogic
ignores the preload directives in the web.xml file (it just doesn't support
this part of the Servlet 2.2 spec, which is amazing considering it somehow
received J2EE certification).

Anyways, even if you do hit the servlet first to initialize it, before
hitting a JSP page, it still won't work. WebLogic has a serious problem with
its classloader architecture.

Here's the summary of my research over the last couple of days: WebLogic
always had a potential classloader problem due to how it did things. There
was a section of the WebLogic docs that described (along with many newsgroup
posts) the 'dreaded ClassCastException problem'. Basically, if you had a
servlet or JSP which stuffed a custom object in the Session object, and then
was reloaded (as a result of a change), the servlet or jsp would be dumped
so it could be reloaded (by a different classloader), and this would also
load any custom objects with the new classloader. When the object from the
session was attempted to be accessed (and cast to the proper type), there
would be a ClassCastException since the two class instances, while referring
to the same code, were considered different due to being loaded by different
classloaders.

Bad enough, but it is a lot worse for J2EE WebApps (ie the .war file
format). In this case, every single Servlet and JSP seems to use a different
classloader (even before a reload), so there is no way to pass custom
objects between them. WebLogic can not support the very common Model 2
architecture where control comes in to a servlet, which puts data into the
Request or Session objects, and does a forward to a JSP.

There appear to be a few ways to try to work around the problem. If you have
control over the entire app (which you do not, in the case of Struts) then
objects can be serialized into the session or request instead of just being
added into it. What I have also seen somebody say will work is if the JSP is
forwarded to via the entire hard-coded url. I may try to verify this; the
problem is that it is much less convenient to work with non-relative paths.
Somebody else has mentioned that setting the JSP working directory to
somewhere on the weblogic classpath instead of the default (under the
web-inf directory) may work. I will try to verify this tomorrow. Even if it
does work, it means that JSPs from all web apps will get lumped together...



-----Original Message-----
From: Irene Hernandez
To: struts-user@jakarta.apache.org
Sent: 8/31/2000 9:46 PM
Subject: problem with Weblogic 5.1

Hi,
 
Can anybody help me with this? I'm trying to run the struts example with
Weblogic 5.1 SP5, but it seems that I still have problems with the page
context... this is the error I get when the example index.jsp is loaded:
 
Thu Aug 31 18:26:37 PDT 2000:<E> <WebAppServletContext-lomm> Root cause
of ServletException
javax.servlet.jsp.JspException: Missing resources attribute
org.apache.struts.action.MESSAGE
 at org.apache.struts.taglib.MessageTag.doStartTag(MessageTag.java:360)
 at jsp_servlet._index._jspService(_index.java:82)
 at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
 at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:124)
 at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:142)
 at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContex
tImpl.java:760)
 at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContex
tImpl.java:707)
 at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletCon
textManager.java:251)
 at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:3
69)
 at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:269)
 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)

thanx for any help
 
Irene

Mime
View raw message