struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommy Pham <tommy...@gmail.com>
Subject missing action
Date Tue, 30 Jul 2013 22:28:29 GMT
Hi,

I'm trying to follow the tutorial:

http://struts.apache.org/release/2.3.x/docs/hello-world-using-struts-2.html

to create a Struts 2 application with maven and eclipse but encountering a
404 error with missing action with this error in the console:

Jul 30, 2013 3:24:41 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger
error
SEVERE: Dispatcher initialization failed
Unable to load configuration. - action -
file:/D:/data/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/sample_app/WEB-INF/classes/struts.xml:17:80
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: Action class
[org.apache.struts.tutorial.action.HelloWorldAction] not found - action -
file:/D:/data/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/sample_app/WEB-INF/classes/struts.xml:17:80
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:482)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:426)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:552)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
at
org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:250)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 17 more

Jul 30, 2013 3:24:41 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - action -
file:/D:/data/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/sample_app/WEB-INF/classes/struts.xml:17:80
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:502)
at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load configuration. - action -
file:/D:/data/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/sample_app/WEB-INF/classes/struts.xml:17:80
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
... 15 more
Caused by: Action class
[org.apache.struts.tutorial.action.HelloWorldAction] not found - action -
file:/D:/data/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/sample_app/WEB-INF/classes/struts.xml:17:80
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:482)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:426)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:552)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
at
org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:250)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 17 more




Here's my struts.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<constant name="struts.devMode" value="true" />

<package name="sampleapp" extends="struts-default">

<action name="index">
<result>/index.jsp</result>
</action>

<action name="hello"
class="org.apache.struts.tutorial.action.HelloWorldAction" method="execute">
<result name="success">/HelloWorld.jsp</result>
</action>

</package>

</struts>


and my HelloWorldAction.java:


package org.apache.struts.tutorial.action;

import org.apache.struts.tutorial.model.MessageStore;
import com.opensymphony.xwork2.ActionSupport;

public class HelloWorldAction extends ActionSupport {

private static final long serialVersionUID = 1L;

private MessageStore messageStore;

public String execute() throws Exception {
messageStore = new MessageStore();
return SUCCESS;
}

public MessageStore getMessageStore() {
return messageStore;
}

public void setMessageStore(MessageStore messageStore) {
this.messageStore = messageStore;
}

}



I've tried maven clean and clean Tomcat work directory but same result.
 Did I misconfigured something?

Thanks,
Tommy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message