This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes WARNING: Could not find action or result Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "WARNING: Could not find action or result" Watch "WARNING: Could not find action or result" New topic
Author

WARNING: Could not find action or result

Ratheesh Kumar K Ratheesh
Greenhorn

Joined: Feb 11, 2009
Posts: 2
Hello All,
I am a newbie to the Struts 2 framework. I started with latest version of Struts 2, i.e. Struts 2.1.6 and is strucked with the following error. I have gone through the entire forums and many other mailing list, but was not able to get it corrected. The war file for the project is attached, please go theough it and send me some solutions. Any pointers and tricks are appreciated. Please execute the war file and then comment on it, because I experimented all the tricks explained in most of the user forums. You can download the war file from here or from here

Following are the development environment configurations:
IDE: Eclipse Platform Version: 3.4.1 Build id: M20080911-1700 [Ganymede]
Servelt Engine: Tomcat 6.0.18
Struts version: 2.1.6
Operating System : Windows XP

Following is the error report:


Feb 10, 2009 9:04:25 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find action or result
There is no Action mapped for namespace / and action name . - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56554
    
  14

Please be sure to post Struts questions in the Struts forum. I have moved this post there for you.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Ratheesh Kumar K Ratheesh
Greenhorn

Joined: Feb 11, 2009
Posts: 2
Thanks Bear Bibeault !!!

here is the directory structure

Following are the major configuration files:

web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>test1</display-name>
<welcome-file-list>
<welcome-file>t1.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

struts.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="Amrita" namespace="Amrita" extends="struts-default">
<action name="loadAmrita" class="org.amrita.testAction">
<result name="input">index.jsp</result>
<result>success.jsp</result>
</action>
</package>
</struts>

testAction.java


package org.amrita;

import com.opensymphony.xwork2.ActionSupport;

public class testAction extends ActionSupport
{
/**
*
*/
private static final long serialVersionUID = 1L;

public String execute()
{
return SUCCESS;
}
}

index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="/struts-tags" prefix="s" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
haiiiiiiiiiii
<s:form action="loadAmrita">
<s:submit value="submit"/>
</s:form>
</body>
</html>

success.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Success !!!
</body>
</html>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

A couple of notes:

* You're missing commons-io.
* Java class names should start with a capital letter, i.e., TestAction.
* You should use the ng filter in 2.1.6.
* Namespaces should begin with a slash ("/").

Is there anything in the log regarding a filter startup failure?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WARNING: Could not find action or result
 
Similar Threads
Struts2 tiles ActionClass not detected
Struts2 namespace url problem
Issue: Populating <s:select> with values from a HashMap
HibernateDaoSupport not compatible with JSON
Struts 2 + Json - Autocompleate example not finding Json Action.