struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PaweĊ‚ Wielgus <poulw...@gmail.com>
Subject Re: Problems loading struts.xml from non-standard directory
Date Sat, 29 Aug 2009 08:36:55 GMT
Hi All,
why can't You add your directory to the classpath?

Best greetings,
Pawel Wielgus.

2009/8/29, Arthur Nogueira Neves <arthurnn@gmail.com>:
> O'Neil, Tom wrote:
>> I'm having problems loading my struts.xml file from a non-standard
>> directory in Struts 2.1.6. My web.xml file contains the following
>>
>>   <filter>
>>     <filter-name>struts2</filter-name>
>>
>> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>>     <init-param>
>>             <param-name>config</param-name>
>>             <param-value>/WEB-INF/struts.xml</param-value>
>>       </init-param>
>>   </filter>
>>   <filter-mapping>
>>     <filter-name>struts2</filter-name>
>>     <url-pattern>/*</url-pattern>
>>   </filter-mapping>
>>
>> I then place my struts.xml file at /WEB-INF/struts.xml. However, when I
>> start the application, I get the exception listed below. If I place the
>> struts.xml file in /WEB-INF/classes, everything loads fine. What needs to
>> be done to load the struts.xml file from somewhere outside of
>> /WEB-INF/classes?
>>
>> 17:21:54,679 INFO  [TomcatDeployment] deploy, ctxPath=/jdb-editor
>> 17:21:54,988 INFO  [XmlConfigurationProvider] Unable to locate
>> configuration files of the name /WEB-INF/struts.xml, skipping
>> 17:21:55,010 INFO  [XmlConfigurationProvider] Parsing configuration file
>> [/WEB-INF/struts.xml]
>> 17:21:55,457 ERROR [[/jdb-editor]] Exception starting filter struts2
>> com.opensymphony.xwork2.inject.DependencyException:
>> com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException:
>> No mapping found for dependency
>> [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public
>> void
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory).
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:144)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:113)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:90)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:86)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:69)
>>       at
>> com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
>>       at
>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>>       at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>       at
>> com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
>>       at
>> com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:483)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:523)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:522)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:521)
>>       at
>> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:188)
>>       at
>> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
>>       at
>> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
>>       at
>> org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
>>       at
>> org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
>>       at
>> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:234)
>>       at
>> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:332)
>>       at
>> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:90)
>>       at
>> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3783)
>>       at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4413)
>>       at
>> org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
>>       at
>> org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
>>       at
>> org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
>>       at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
>>       at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
>>       at sun.reflect.GeneratedMethodAccessor279.invoke(Unknown Source)
>>       at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>       at java.lang.reflect.Method.invoke(Method.java:597)
>>       at
>> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
>>       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
>>       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>>       at
>> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>>       at
>> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
>>       at
>> org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
>>       at $Proxy38.start(Unknown Source)
>>       at
>> org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
>>       at
>> org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
>>       at
>> org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
>>       at
>> org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
>>       at
>> org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
>>       at
>> org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
>>       at
>> org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
>>       at
>> org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
>>       at
>> org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
>>       at
>> org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
>>       at
>> org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
>>       at
>> org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
>>       at
>> org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
>>       at
>> org.jboss.system.ServiceController.doChange(ServiceController.java:688)
>>       at
>> org.jboss.system.ServiceController.start(ServiceController.java:460)
>>       at
>> org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
>>       at
>> org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
>>       at
>> org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
>>       at
>> org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
>>       at
>> org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
>>       at
>> org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
>>       at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
>>       at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
>>       at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
>>       at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
>>       at
>> org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
>>       at
>> org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
>>       at
>> org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
>>       at
>> org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
>>       at
>> org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
>>       at
>> org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
>>       at
>> org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
>>       at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
>>       at
>> org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
>>       at
>> org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
>>       at
>> org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
>>       at
>> org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
>>       at
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>>       at
>> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>>       at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>>       at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
>>       at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>>       at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>       at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>       at java.lang.Thread.run(Thread.java:619)
>> Caused by:
>> com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException:
>> No mapping found for dependency
>> [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public
>> void
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory).
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:235)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:225)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.<init>(ContainerImpl.java:287)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:117)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:115)
>>       at
>> com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:141)
>>       ... 86 more
>>
>>
>> -----------------------------------------------------
>> Tom O'Neil
>> Director of Engineering
>> IHS Jane's
>> 1-347-414-9044
>> tom.oneil@janes.com<mailto:tomoneil@documental-solutions.com>
>>
>> NOTICE:  This message, together with any attachments, contains information
>> that may be confidential and privileged.  Unless you are the addressee (or
>> authorized by the addressee), you may not use, copy, print or disclose to
>> anyone this message or any information contained in this message.  If you
>> have received this email in error, please delete it immediately from your
>> system and notify the sender promptly by email you have done so. While we
>> check the communications we send for virus infection, we accept no
>> responsibility for any loss or damage caused to your systems by the
>> communication you receive. This e-mail or its attachments may contain
>> personal views which are not the views of Jane's Information Group unless
>> specifically stated.
>>
>>
>>
> Hi,
>
> I think It is impossible to do today, you just put the struts.xml inside
> the classpath, than you must put the struts.xml inside any folder into
> application classpath...
> If anyone know how to do this, tell me. If there isnt a way, I can
> create a path to update struts2 for attending this issue.
>
>
> Regards
>
> Arthur Nogueira Neves
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Mime
View raw message