You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Graham Leggett <mi...@sharp.fm> on 2003/11/14 23:59:34 UTC

Struts throwing away exceptions

Hi all,

I ran into this problem a while back, worked around it, but now it is back.

Something has gone haywire with a struts web application I am trying to 
debug. When accessing an URL, I get an HTTP 400 error, with the 
explanation "The request sent by the client was syntactically incorrect 
().".

 From my last experience with this problem, it turned out then to be a 
NullPointerException with no reason string - thus the empty string 
between the brackets. The problem is, the original exception has been 
thrown away by struts, so I have no clue where to start looking for the 
problem.

The cause of this issue is that all messages, including HTTP error 
codes, are being logged via commons-logging, which in this case has gone 
haywire along with the application. The correct behaviour IMHO in a 
situation where struts is in a broken state, is to pass the exception 
along with the HTTP error code to the servlet container, thus removing 
an enormous source of frustration for struts developers where a problem 
is reported seamingly by tomcat, but with no clue where the problem came 
from.

Regards,
Graham
--


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Struts throwing away exceptions

Posted by Ted Husted <hu...@apache.org>.
We appreciate the report. If you have any concrete suggestions, please 
feel free to submit a report to Bugzilla with any fixes. As it stands, 
Struts is relying on the logging subsystem to pass the messages along to 
the servlet container (Tomcat). If the subsystem responds normally to 
Struts, then it's not possible for Struts to know that anything is broken.

If it were me, I'd try a fresh deployment, preferrably on another 
machine, in case the underlying problem is corrupt JARs.

An array of test cases can also help in cases like this, since they can 
pinpoint where things have gone awry. Often, things like NPEs can be 
exposed by testing the underlying business logic directly.

-Ted.

Graham Leggett wrote:
> Hi all,
> 
> I ran into this problem a while back, worked around it, but now it is back.
> 
> Something has gone haywire with a struts web application I am trying to 
> debug. When accessing an URL, I get an HTTP 400 error, with the 
> explanation "The request sent by the client was syntactically incorrect 
> ().".
> 
>  From my last experience with this problem, it turned out then to be a 
> NullPointerException with no reason string - thus the empty string 
> between the brackets. The problem is, the original exception has been 
> thrown away by struts, so I have no clue where to start looking for the 
> problem.
> 
> The cause of this issue is that all messages, including HTTP error 
> codes, are being logged via commons-logging, which in this case has gone 
> haywire along with the application. The correct behaviour IMHO in a 
> situation where struts is in a broken state, is to pass the exception 
> along with the HTTP error code to the servlet container, thus removing 
> an enormous source of frustration for struts developers where a problem 
> is reported seamingly by tomcat, but with no clue where the problem came 
> from.
> 
> Regards,
> Graham
> -- 



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Struts throwing away exceptions

Posted by David Graham <gr...@yahoo.com>.

Graham Leggett <mi...@sharp.fm> wrote:
Hi all,

I ran into this problem a while back, worked around it, but now it is back.

Something has gone haywire with a struts web application I am trying to 
debug. When accessing an URL, I get an HTTP 400 error, with the 
explanation "The request sent by the client was syntactically incorrect 
().".

>From my last experience with this problem, it turned out then to be a 
NullPointerException with no reason string - thus the empty string 
between the brackets. The problem is, the original exception has been 
thrown away by struts, so I have no clue where to start looking for the 
problem.

What makes you think Struts is throwing away the exception?  What was the stack trace for the NPE?

David



The cause of this issue is that all messages, including HTTP error 
codes, are being logged via commons-logging, which in this case has gone 
haywire along with the application. The correct behaviour IMHO in a 
situation where struts is in a broken state, is to pass the exception 
along with the HTTP error code to the servlet container, thus removing 
an enormous source of frustration for struts developers where a problem 
is reported seamingly by tomcat, but with no clue where the problem came 
from.

Regards,
Graham
--


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org




---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard