Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

STRUTS - Invalid path

 
shivakumar sekaran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting the following Invalid Path error when I tried to add a new action block in the struts-config.xml file.

<action path="/cc" type="com.xyz.reports.CountryWiseInputAction"
name="countrywisedetails" scope="request" validate="false">
<forward name="success" path="/content/reports/CountryWiseInput.jsp"/>
</action>

The error I am getting is :
----------------------------

Path Info: null
Request URI: /TApp/error.jsp
Error Code : 400
Error occured while processing request : http://xyz.com/TApp/error.jsp
Exception Type : com.ibm.servlet.engine.webapp.WebAppErrorReport
Message : Invalid path /cc was requested
Stack Trace : com.ibm.servlet.engine.webapp.WebAppErrorReport: Invalid path /cc was requested at com.ibm.servlet.engine.webapp.WebAppDispatcherResponse.sendError(WebAppDispatcherResponse.java:93) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1557) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:721) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:374) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:118) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:151) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:317) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:391) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:274) at com.ibm.ws.util.CachedThread.run(ThreadPool.java:144)


Any idea why I am getting this.

Thanks for your help.

-Shiva-
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using path or extension mapping? This is configured in the servlet-mapping section of your web.xml.

Path Mapping looks like this:


Extension Mapping looks like this:


Did you include the servlet context on your url?
[ May 25, 2004: Message edited by: Chris Mathews ]
 
shivakumar sekaran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,

I am using extension mapping. The mapping in my web.xml looks like this.

<servlet-mapping>
<servlet-name>ActionServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

Actually there are lot of other action blocks which I have added earlier works fine. I tried changing the names(value) of the path attribute for this option. Everytime it throws the same error. It does not reach the Action class (com.xyz.reports.CountryWiseInputAction in my case) mentioned in the type attribute at all. No idea whats going wrong here.

I am able to get the context path as well : This is what I get

Context path : /TApp

The place/file from where I am invoking this option looks like this:
.
.
.
.
Menu3_4=new Array("Policy and Location >>","","",2,20,180);
Menu3_4_1=new Array("Policy","<html:rewrite page='/viewPolicyReport.do'/>","",0,20,180);
Menu3_4_2=new Array("Location","<html:rewrite page='/viewLocationReport.do'/>","",0,20,180);

Menu3_5=new Array("Country Wise Report >>","","",1,20,180);
Menu3_5_1=new Array("Country Wise","<html:rewrite page='/cc.do'/>","",0,20,180);

Thanks a lot for all your help.
-Shiva-
 
shivakumar sekaran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,

I got it resolved. The struts-config.xml in the remote machine was not reflecting the changes after the build and deployment (UNIX server). It was looking up at a different (struts-config)file in the server. It did work locally. I rectified that and its working now.

Many Thanx for your support.

Cheers!
Shiva
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic