There is no Action mapped for namespace / and action name CreateTicket-Collection of common programming errors
I am getting the below error, I have googled lot and got many different types of solutions but not able to resolve it.
My Stacktrace
SEVERE: Could not find action or result
There is no Action mapped for namespace / and action name CreateTicket. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
My Struts.xml
Welcome.jsp
Login.jsp
My Directory Structure
CreateTicket.java
package com.ticketservice;
import com.opensymphony.xwork2.ActionSupport;
public class CreateTicket extends ActionSupport {
public String execute() {
return "success";
}
}
Welcome.jsp
done
Login.jsp
not done
I have create this project to learn Struts so only wanted to see how mapping of struts.xml to action class done
I am successfully able to run localhost:8080/TicketSystem/index.html.
But when I run localhost:8080/TicketSystem/CreateTicket.action. I got the above error..
Kindly help me to resolve it.
Regards, Mahesh
-
I think it’s because you haven’t defined the namespace.
Try this.
-
The reason I was getting this error was my build path. My build path was set to other directory not at WBB-INF classes. Doing so, solved my problem.