File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 config error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 config error" Watch "Struts2 config error" New topic

Struts2 config error

Shashank Bekal

Joined: Jan 27, 2010
Posts: 2

I am new to Struts2 and I am developing my first application. I am getting this error which has almost made me Quit. Please help me how can I get rid of this and run my application.

IDE: Eclipse Galileo(3.5.1)
Server: Tomcat 6.0

Folder Structure:


Jars inside SecondAttempt/WebContent/Web-INF/lib/











When I run this code I get this error:
Jan 28, 2010 12:16:27 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /
Jan 28, 2010 12:16:27 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/29 config=null
Jan 28, 2010 12:16:27 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1070 ms
Jan 28, 2010 12:16:32 AM org.apache.struts2.components.ActionComponent executeAction
SEVERE: Could not execute action: //jsp/HelloWorld
There is no Action mapped for namespace //jsp and action name HelloWorld. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(
at org.apache.struts2.components.ActionComponent.executeAction(
at org.apache.struts2.components.ActionComponent.end(
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(
at org.apache.jsp.jsp.index_jsp._jspx_meth_s_005faction_005f0(
at org.apache.jsp.jsp.index_jsp._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)

Please tell me if the problem is with the folder structure or the links or something else.
Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

Hi Shashank, welcome to javaranch.

Shashank please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it.

As the error indicates, struts is looking for an action named HelloWorld in /jsp namespace because your index.jsp is in the /jsp folder. If an action is not found in a namespace, struts looks for that action in the default namespace. I don't know why struts is not looking for HelloWorld action in default namespace, David can throw light on it (maybe I missed something). Also check if you have all the dependencies in your application's libraries (struts 2.0.14)...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Shashank Bekal

Joined: Jan 27, 2010
Posts: 2

I have updated the post with code tags. I hope this helps.
I agree. Here's the link:
subject: Struts2 config error
It's not a secret anymore!