You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tommy Pham <to...@gmail.com> on 2013/07/31 00:28:29 UTC
missing action
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
Re: Test with StrutsJUnit4TestCase
Posted by Lukasz Lenart <lu...@apache.org>.
Please register an issue in JIRA
2013/8/17 Alireza Fattahi <af...@yahoo.com>:
> Hi,
>
> Regarding to page:
> http://struts.apache.org/release/2.2.x/docs/struts-2-junit-plugin-tutorial.html
>
> I could not find the getConfigPath() method in StrustTestCase class
> I searched the javadocs and I found that only the StrutsJUnit4TestCase class has the getcinfigpath() method.
> So I should start to use JUnit4, but the example in above link seems not good for that.
> 1- Does any one know a toturial that can help me to start with this.
> 2- When I add struts2-junit-plugin to maven, should I manually add junit for to maven. the struts2-junit-plugin does not have any dependecy with junit4 har.
>
>
> ~Regards,
> ~~Alireza Fattahi
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Test with StrutsJUnit4TestCase
Posted by Lukasz Lenart <lu...@apache.org>.
2013/8/17 Alireza Fattahi <af...@yahoo.com>:
> I forgot to merntion:
> When I extend StrutsJUnit4TestCase the assertTrue method is not found !
You must import them statically
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: convetion maps parent actions too!
Posted by Lukasz Lenart <lu...@apache.org>.
2013/8/19 Alireza Fattahi <af...@yahoo.com>:
> Hi,
>
> I am usging convetion. All my actions extended a base action like
>
> public class AccountAction extends MyBaseActionSupport{
>
> }
>
> The convention maps the MyBaseActionSupport too.
> Is there any way we can avoid it.
Is it an abstract class?
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
convetion maps parent actions too!
Posted by Alireza Fattahi <af...@yahoo.com>.
Hi,
I am usging convetion. All my actions extended a base action like
public class AccountAction extends MyBaseActionSupport{
}
The convention maps the MyBaseActionSupport too.
Is there any way we can avoid it.
~Regards,
~~Alireza Fattahi
Re: Spring Anotaction with Strust
Posted by Lukasz Lenart <lu...@apache.org>.
2013/8/17 Alireza Fattahi <af...@yahoo.com>:
> Hi,
> May be this a spring question but please help me...
> Consider the example:
> http://struts.apache.org/release/2.2.x/docs/spring-and-struts-2.html
>
> I want to use spring anotation for defining the beans.
> So I make a EditServiceInMemory class as below:
>
> @Configuration
> public class EditServiceInMemory{
Rather use @Service
> @Bean
> public void editService() {
hm.... method that doesn't return anything is annotated as Bean producer ;-)
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Spring Anotaction with Strust
Posted by Alireza Fattahi <af...@yahoo.com>.
Hi,
May be this a spring question but please help me...
Consider the example:
http://struts.apache.org/release/2.2.x/docs/spring-and-struts-2.html
I want to use spring anotation for defining the beans.
So I make a EditServiceInMemory class as below:
@Configuration
public class EditServiceInMemory{
@Bean
public void editService() {
}
}
Accroding to spring above should be same as:
<bean id="editService" class="org.apache.struts.edit.service.EditServiceInMemory" />
But the anotation is not working!
Is is any thing regarding to spring plug in ?!
I also added the below in applicationContext.xml:
<context:annotation-config/>
~Regards,
~~Alireza Fattahi
Re: Test with StrutsJUnit4TestCase
Posted by Alireza Fattahi <af...@yahoo.com>.
I forgot to merntion:
When I extend StrutsJUnit4TestCase the assertTrue method is not found !
~Regards,
~~Alireza Fattahi
________________________________
From: Alireza Fattahi <af...@yahoo.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Saturday, 17 August 2013, 13:18
Subject: Test with StrutsJUnit4TestCase
Hi,
Regarding to page:
http://struts.apache.org/release/2.2.x/docs/struts-2-junit-plugin-tutorial.html
I could not find the getConfigPath() method in StrustTestCase class
I searched the javadocs and I found that only the StrutsJUnit4TestCase class has the getcinfigpath() method.
So I should start to use JUnit4, but the example in above link seems not good for that.
1- Does any one know a toturial that can help me to start with this.
2- When I add struts2-junit-plugin to maven, should I manually add junit for to maven. the struts2-junit-plugin does not have any dependecy with junit4 har.
~Regards,
~~Alireza Fattahi
Test with StrutsJUnit4TestCase
Posted by Alireza Fattahi <af...@yahoo.com>.
Hi,
Regarding to page:
http://struts.apache.org/release/2.2.x/docs/struts-2-junit-plugin-tutorial.html
I could not find the getConfigPath() method in StrustTestCase class
I searched the javadocs and I found that only the StrutsJUnit4TestCase class has the getcinfigpath() method.
So I should start to use JUnit4, but the example in above link seems not good for that.
1- Does any one know a toturial that can help me to start with this.
2- When I add struts2-junit-plugin to maven, should I manually add junit for to maven. the struts2-junit-plugin does not have any dependecy with junit4 har.
~Regards,
~~Alireza Fattahi
Re: missing action
Posted by Tommy Pham <to...@gmail.com>.
Hi Lukasz,
Been busy with other things and didn't have time troubleshoot it. I
finally got it to work properly via:
Maven clean
Maven install
Run on Server
Thanks,
Tommy
On Wed, Jul 31, 2013 at 1:24 AM, Lukasz Lenart <lu...@apache.org>wrote:
> This is a well know problem with Eclipse - it stop deploying new
> version at some point. Try to Clean and Deploy (that how it was in
> NetBeans - I don't have Eclipse)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: missing action
Posted by Lukasz Lenart <lu...@apache.org>.
This is a well know problem with Eclipse - it stop deploying new
version at some point. Try to Clean and Deploy (that how it was in
NetBeans - I don't have Eclipse)
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: missing action
Posted by Christian Grobmeier <gr...@gmail.com>.
I am not familiar with the "Run As" options of the IDE as I use
command line for such tasks, but basically you are expected to create
a war file and deploy it to your container when something changes.
Personally I am using the mvn jetty plugin and Jrebel (when doing open
source work) for that.
Can you check if the class file is actually existent in your container?
Also you try to re-create a war file and see if it works.
Cheers
On Wed, Jul 31, 2013 at 4:10 AM, Tommy Pham <to...@gmail.com> wrote:
> Hi Dave,
>
> I right click on the project > "Run As" > Run on server. It worked OK
> when for the previous tutorial:
>
> http://struts.apache.org/release/2.3.x/docs/create-struts-2-web-application-using-maven-to-manage-artifacts-and-to-build-the-application.html
>
> Am I supposed to build a war and deploy it that way even though I have
> Tomcat on my dev system?
>
> Thanks,
> Tommy
>
>
> On Tue, Jul 30, 2013 at 6:43 PM, Dave Newton <da...@gmail.com> wrote:
>
>> How are you deploying the app?
>> On Jul 30, 2013 6:28 PM, "Tommy Pham" <to...@gmail.com> wrote:
>>
>> > 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
>> >
>>
--
http://www.grobmeier.de
https://www.timeandbill.de
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: missing action
Posted by Tommy Pham <to...@gmail.com>.
Hi Dave,
I right click on the project > "Run As" > Run on server. It worked OK
when for the previous tutorial:
http://struts.apache.org/release/2.3.x/docs/create-struts-2-web-application-using-maven-to-manage-artifacts-and-to-build-the-application.html
Am I supposed to build a war and deploy it that way even though I have
Tomcat on my dev system?
Thanks,
Tommy
On Tue, Jul 30, 2013 at 6:43 PM, Dave Newton <da...@gmail.com> wrote:
> How are you deploying the app?
> On Jul 30, 2013 6:28 PM, "Tommy Pham" <to...@gmail.com> wrote:
>
> > 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
> >
>
Re: missing action
Posted by Dave Newton <da...@gmail.com>.
How are you deploying the app?
On Jul 30, 2013 6:28 PM, "Tommy Pham" <to...@gmail.com> wrote:
> 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
>