You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/07/03 07:12:35 UTC

DO NOT REPLY [Bug 29898] New: - Unhelpful runtime error is hard to debug

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29898>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29898

Unhelpful runtime error is hard to debug

           Summary: Unhelpful runtime error is hard to debug
           Product: Struts
           Version: 1.1 Final
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Controller
        AssignedTo: dev@struts.apache.org
        ReportedBy: eakle@cabin16.com


I am relatively new to Struts and struggled with this problem most of today,
eventually changing parts of my application and rerunning, until the error
finally went away, and then drilling into that until I finally understood the
problem.  I Googled for the error and found others have apparently also run into
it over the years, but I didn't find any suggested fixes.  It wound up being a
problem in my struts-config.xml for an action -- the "input" parameter had a
problem.

Here is the runtime error I see in my browser:
------------------------------------------------------------
HTTP Status 500 -
type Exception report
message description
The server encountered an internal error () that prevented it from fulfilling
this request.

exception

java.lang.IllegalArgumentException: Path search does not start with a "/" character
	org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1007)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:961)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:931)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:247)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.
Apache Tomcat/5.0.19
------------------------------------------------------------

Portion of my struts-config:
<!-- ========== Global Forward Definitions ============================== -->
  <global-forwards>
    <forward   name="search"         path="/search.jsp"/>
    <forward   name="searchResult"   path="/searchResult.jsp"/>
    <forward   name="viewSource"     path="/viewSource.jsp"/>
  </global-forwards>

  <!-- ========== Action Mapping Definitions ============================== -->
  <action-mappings>
    <action    path      = "/searchPage"
               type      = "com.es.actions.SearchAction"
               name      = "searchForm"
               scope     = "request"
               validate  = "true"
	       input     = "search"

changing "input" param above to the following will fix the above runtime error:
               input     = "/viewSource.jsp"

What would have helped me from so much grief today:
1. Have error (possibly caught earlier) indicate more context; if possible, that
the problem is with the path associated with a form validation error.
2. Put quotes around the bad path in the error message so it would read: Path
'search' does not...   (at first I thought that possibly the word 'search' is a
normal part of this message :-)
Thanks.

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