struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Grobmeier <grobme...@gmail.com>
Subject Re: missing action
Date Wed, 31 Jul 2013 08:20:25 GMT
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 <tommyhp2@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 <davelnewton@gmail.com> wrote:
>
>> How are you deploying the app?
>> On Jul 30, 2013 6:28 PM, "Tommy Pham" <tommyhp2@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


Mime
View raw message