struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RogerV <roger.var...@googlemail.com>
Subject Overriding default action mapper
Date Fri, 09 Oct 2009 21:59:31 GMT

I've followed the instructions at
http://struts.apache.org/2.0.14/docs/actionmapper.html and defined my custom
mapper that extends DefaultActionMapper in struts.xml, but it won't load
because the mapper has already been loaded. I've never tried anything like
this before so I'm at a total loss to know what's wrong.

My struts.xml looks like this and the stack trace is below;

<?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>

 <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="struts"
class="com.vasilikon.dispatcher.mapper.ButtonWithParameterActionMapper" />
    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.devMode" value="true"/> 
</struts>

Regards
Roger



SEVERE: Dispatcher initialization failed
Unable to load configuration. - bean -
file:/home/varleyr/blackbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/newmapper/WEB-INF/classes/struts.xml:8:153
	at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
	at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
	at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
	at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
	at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
	at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
	at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: Unable to load bean:
type:org.apache.struts2.dispatcher.mapper.ActionMapper
class:com.vasilikon.dispatcher.mapper.ButtonWithParameterActionMapper - bean
-
file:/home/varleyr/blackbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/newmapper/WEB-INF/classes/struts.xml:8:153
	at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:221)
	at
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
	at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:169)
	at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
	... 22 more
Caused by: Bean type interface
org.apache.struts2.dispatcher.mapper.ActionMapper with the name struts has
already been loaded by [unknown location] - bean -
file:/home/varleyr/blackbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/newmapper/WEB-INF/classes/struts.xml:8:153
	at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:205)
	... 25 more
10-Oct-2009 00:41:20 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - bean -
file:/home/varleyr/blackbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/newmapper/WEB-INF/classes/struts.xml:8:153
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
	at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
	at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
	at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
	at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
	at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: Unable to load configuration. - bean -
file:/home/varleyr/blackbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/newmapper/WEB-INF/classes/struts.xml:8:153
	at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
	at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
	... 20 more
Caused by: Unable to load bean:
type:org.apache.struts2.dispatcher.mapper.ActionMapper
class:com.vasilikon.dispatcher.mapper.ButtonWithParameterActionMapper - bean
-
file:/home/varleyr/blackbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/newmapper/WEB-INF/classes/struts.xml:8:153
	at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:221)
	at
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
	at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:169)
	at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
	... 22 more
Caused by: Bean type interface
org.apache.struts2.dispatcher.mapper.ActionMapper with the name struts has
already been loaded by [unknown location] - bean -
file:/home/varleyr/blackbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/newmapper/WEB-INF/classes/struts.xml:8:153
	at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:205)
	... 25 more

-- 
View this message in context: http://www.nabble.com/Overriding-default-action-mapper-tp25828522p25828522.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message