Struts 1.1 requires it (should solve your problem of "ActionServlet failing to load", though I admint I've never seen that exact manifestation of the problem before so I could be wrong). I suggest a value of 1, but it really depends on your application. Are there any other Servlets in your application that you need to initialize first?

Erik



Daffin, Miles (Company IT) wrote:

Should I have done? What is the expected result?
1) If no such param is specified.
2) If the param is specified.

And what value would you recommend?

Thanks.

Miles



-----Original Message-----
From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: 12 November 2004 16:28
To: Struts Users Mailing List
Subject: Re: STRUTS Application still appears viable even though ActionServlet has failed to initialize.


Have you specified the load-on-startup attribute for the controller Servlet in web.xml?

Erik


Daffin, Miles (Company IT) wrote:



Hi,

Can anyone tell me if this is a bug?

I have a struts 1.1 app with a typical default index.jsp

redirecting to

the entry point action:

<logic:redirect forward="/startForm3"/>

This was failing to because of the following NPE:

---
java.lang.NullPointerException
at
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:521)
at
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:436)
at
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:396)
at
org.apache.struts.taglib.logic.RedirectTag.doEndTag(RedirectT


ag.java:29


4
)
---

I can see from a quick google that this is a frequently experienced problem and yet I have not seen a satisfactory solution.

If we look into the RequestUtils code we find that the

problem is that

the ModuleConfig cannot be found on either the request or in the application context. When the forward config for the string

in the jsp

is looked up we therfore get the NPE.

If we look into the container logs we find the root cause: the ActionServlet failed to load:

---
javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet
at
org.apache.catalina.core.StandardWrapper.loadServlet(Standard


Wrapper.ja


v
a:986)
...
----- Root Cause -----
java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method)
---


One assumes that the ActionServlet did not load the

ModuleConfig, and

that the application is *not* therefore really viable - although it seems to think it is...

So. My question is: is this a struts bug? Should the application be attempting to service requests if its central component

failed to boot

correctly?

The side effects this causes are hard to diagnose and I

suggest that it

would be better if, in situations like this, all further

requests were

responded to with an Error 500 and the stacktrace for the original problem.

My apologies if this is one of a thousand emails on the same

subject. I

searched the archive prior to writing this.

-Miles

Miles Daffin
Morgan Stanley
20 Cabot Square | Canary Wharf | London E14 4QA | UK
Tel: +44 (0) 20 767 75119
[EMAIL PROTECTED]


<mailto:[EMAIL PROTECTED]>


--------------------------------------------------------

NOTICE: If received in error, please destroy and notify

sender. Sender does not waive confidentiality or privilege, and use is prohibited.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to