You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "olivier dupuy (JIRA)" <ji...@apache.org> on 2009/03/17 15:39:02 UTC

[jira] Commented: (WW-2866) A ServletException without details seems thrown when an action listed in Struts.xml is not found, add details in the exception and log a fatal error

    [ https://issues.apache.org/struts/browse/WW-2866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45730#action_45730 ] 

olivier dupuy commented on WW-2866:
-----------------------------------

With all due respect this kind of behavior is a real pain especially if you are in the middle of heavy refactoring. This is maybe not a problem but for sure a pain.

If you could pinpoint in the output to:
- the XML file which cannot be used for the configuration (or lets dream the line too)
- the class which is not found
this would be much helpful.

I do not know about other files used by Struts2 such as Validator.xml can have the same problems but if this this the case then same expected behavior.

BTW I do not use Spring at all in my project, there is no Spring library in my environment.

>From what I have seen in ObjectFactory.getClassInstance() of xworks2.0.4.jar the call does not log a message.
The same for ClassLoaderUtil.loadClass() in the same file.

ObjectFactory IMO should log something.


Thanks
Olivier


> A ServletException without details seems thrown when an action listed in Struts.xml is not found, add details in the exception and log a fatal error
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2866
>                 URL: https://issues.apache.org/struts/browse/WW-2866
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: XML Configuration
>    Affects Versions: 2.0.11
>         Environment: Windows XP SP2, Tomcat 5.5 JDK 1.5.0.12
>            Reporter: olivier dupuy
>            Priority: Minor
>             Fix For: 2.1.7
>
>
> A ServletException without details seems thrown when an action listed in Struts.xml is not found, add details in the exception and log a fatal error
> Take your struts.xml which runs fine and having a line such as 
> 		<action name="home" class="pwgsc.rpgis.struts.common.HomeAction">
> 			<result type="tiles" name="success">home</result>
> 		</action>
> Now in your IDE, rename the class HomeAction to HomePageAction or move it in a different package.
> My RSA IDE knows nothing about Struts 2 so suddenly struts.xml is no more accurate.
> Start the server, on the initialization of the Struts2 filter, in init() the file seems to be parsed and certainly instances of the actions created. Whatever, the init() fails and all I get from the Tomcat output is "SEVERE: Error filterStart."
> I have tried to increase the logging, log4j being configured and initialized before Struts2 with Struts2 and XWork both configured as DEBUG
> I have struts.devMode = true in struts.properties
> No way to figure out what it was. It took me some time to figure out what was the issue.
> The problem can be reproduced every time.
> I strongly suggest to create a clear ServletException in your filter using the constructor with the String specifying the offending class or the part of the configuration file(s) which is bad (file + line)
> In addition of that, I would suggest to use commons logging to display a clear fatal message with details.
> It's quite weird to see all the amount of logging when it is turned on when processing a request while nothing is logged at the initialization of the filter.
> Thanks
> Olivier

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.