You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ádamo Azambuja <ad...@gmail.com> on 2007/10/18 15:39:21 UTC

struts There is no Action mapped for namespace / and action name

 i Have this problem and i lost 2 days trying do fix, what can i do in this
case?

I use java 1.4.2 / Struts 2 J4 / Hibernate and Spring.

i have the HelloWorld.java in the src and src/action to test.


*struts.xml *
<include file="struts-default.xml"/>

<constant name="struts.objectFactory" value="
org.apache.struts2.spring.StrutsSpringObjectFactory" />

<constant name="struts.devMode" value="true" />
<package name="action" extends="struts-default">
<action name="HelloWorld" class="HelloWorld">
<result name="none">/HelloWorld.jsp</result>
</action>
</package>

*applicationContext.xml *
<bean class="
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter" />
<bean id="helloWorld"
class="HelloWorldAction" singleton="false">
</bean>

*web.xml *
<filter>
<filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name >struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-c lass>

</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

-- 
Ádamo B. Azambuja
JEE Developer
icq: 112102893
msn: adamobas@hotmail.com
E-Mail 1: adamobas@yahoo.com.br
E-Mail 2: adamobas@gmail.com

Re: struts There is no Action mapped for namespace / and action name

Posted by Ádamo Azambuja <ad...@gmail.com>.
i put the log4j and my problem now is this:


13:31:21,484 DEBUG XmlConfigurationProvider:873 - Loaded action
configuration from: struts-plugin.xml
13:31:21,484  INFO XmlConfigurationProvider:140 - Parsing configuration file
[struts-plugin.xml]
StandardContext[/fiergs]Exception starting filter struts
Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:
org.apache.struts2.spring.StrutsSpringObjectFactory - bean -
jar:file:/C:/projetos/Fiergs/WebContent/WEB-INF/lib/struts2-
spring-plugin-2.0.9.jar!/struts-plugin.xml:8:132
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(
XmlConfigurationProvider.java:208)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(
StrutsXmlConfigurationProvider.java:101)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(
DefaultConfiguration.java:131)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(
Dispatcher.java:395)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(
FilterDispatcher.java:201)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
ApplicationFilterConfig.java:225)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(
ApplicationFilterConfig.java:308)


2007/10/18, Zarar Siddiqi <za...@gmail.com>:
>
> Problems that I see:
>
> 1. Spring bean is defined as "helloWorld" but referred to as
> "HelloWorld" in Struts config (case is incorrect).
>
> 2. You're saying that your action class is under src/action so I would
> think the fully qualified name of the class might be
> action.HelloWorldAction but that's now how you're referring to it in
> the Spring config.  Also, is your class called HelloWorldAction or
> HelloWorld? Just pick one and use that as your Java file name and the
> class name.
>
> 3. <result name="none">: Usually result is success but I guess you
> could actually return ActionSupport.NONE in your action but I get a
> feeling you're not doing that either.
>
> Zarar
>
>
> On 10/18/07, Ádamo Azambuja <ad...@gmail.com> wrote:
> >  i Have this problem and i lost 2 days trying do fix, what can i do in
> this
> > case?
> >
> > I use java 1.4.2 / Struts 2 J4 / Hibernate and Spring.
> >
> > i have the HelloWorld.java in the src and src/action to test.
> >
> >
> > *struts.xml *
> > <include file="struts-default.xml"/>
> >
> > <constant name="struts.objectFactory" value="
> > org.apache.struts2.spring.StrutsSpringObjectFactory" />
> >
> > <constant name="struts.devMode" value="true" />
> > <package name="action" extends="struts-default">
> > <action name="HelloWorld" class="HelloWorld">
> > <result name="none">/HelloWorld.jsp</result>
> > </action>
> > </package>
> >
> > *applicationContext.xml *
> > <bean class="
> > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter" />
> > <bean id="helloWorld"
> > class="HelloWorldAction" singleton="false">
> > </bean>
> >
> > *web.xml *
> > <filter>
> > <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
> > <filter-class>
> > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
> > </filter-class>
> > </filter>
> > <filter-mapping>
> > <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
> > <url-pattern>/*</url-pattern>
> > </filter-mapping>
> > <filter>
> > <filter-name >struts</filter-name>
> > <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-c
> lass>
> >
> > </filter>
> > <filter-mapping>
> > <filter-name>struts</filter-name>
> > <url-pattern>/*</url-pattern>
> > </filter-mapping>
> >
> > --
> > Ádamo B. Azambuja
> > JEE Developer
> > icq: 112102893
> > msn: adamobas@hotmail.com
> > E-Mail 1: adamobas@yahoo.com.br
> > E-Mail 2: adamobas@gmail.com
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Ádamo B. Azambuja
JEE Developer
icq: 112102893
msn: adamobas@hotmail.com
E-Mail 1: adamobas@yahoo.com.br
E-Mail 2: adamobas@gmail.com

Re: struts There is no Action mapped for namespace / and action name

Posted by Zarar Siddiqi <za...@gmail.com>.
Problems that I see:

1. Spring bean is defined as "helloWorld" but referred to as
"HelloWorld" in Struts config (case is incorrect).

2. You're saying that your action class is under src/action so I would
think the fully qualified name of the class might be
action.HelloWorldAction but that's now how you're referring to it in
the Spring config.  Also, is your class called HelloWorldAction or
HelloWorld? Just pick one and use that as your Java file name and the
class name.

3. <result name="none">: Usually result is success but I guess you
could actually return ActionSupport.NONE in your action but I get a
feeling you're not doing that either.

Zarar


On 10/18/07, Ádamo Azambuja <ad...@gmail.com> wrote:
>  i Have this problem and i lost 2 days trying do fix, what can i do in this
> case?
>
> I use java 1.4.2 / Struts 2 J4 / Hibernate and Spring.
>
> i have the HelloWorld.java in the src and src/action to test.
>
>
> *struts.xml *
> <include file="struts-default.xml"/>
>
> <constant name="struts.objectFactory" value="
> org.apache.struts2.spring.StrutsSpringObjectFactory" />
>
> <constant name="struts.devMode" value="true" />
> <package name="action" extends="struts-default">
> <action name="HelloWorld" class="HelloWorld">
> <result name="none">/HelloWorld.jsp</result>
> </action>
> </package>
>
> *applicationContext.xml *
> <bean class="
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter" />
> <bean id="helloWorld"
> class="HelloWorldAction" singleton="false">
> </bean>
>
> *web.xml *
> <filter>
> <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
> <filter-class>
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
> </filter-class>
> </filter>
> <filter-mapping>
> <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <filter>
> <filter-name >struts</filter-name>
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-c lass>
>
> </filter>
> <filter-mapping>
> <filter-name>struts</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
>
> --
> Ádamo B. Azambuja
> JEE Developer
> icq: 112102893
> msn: adamobas@hotmail.com
> E-Mail 1: adamobas@yahoo.com.br
> E-Mail 2: adamobas@gmail.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org