[ 
https://issues.apache.org/jira/browse/WW-4902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16577249#comment-16577249
 ] 

George Felix Barbosa commented on WW-4902:
------------------------------------------

I'd also say that you have a duplicated jar in your classpath, probably theĀ 
xwork2.

> Struts 2 fails to init Dispatcher - Tomcat Embedded
> ---------------------------------------------------
>
>                 Key: WW-4902
>                 URL: https://issues.apache.org/jira/browse/WW-4902
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.3.34
>            Reporter: George Felix Barbosa
>            Assignee: Yasser Zamani
>            Priority: Major
>             Fix For: 2.6
>
>
> I'm migrating a webapp from Jboss 7.1.1 to tomcat embedded 8.5.14. It works 
> fine while I run it on Intellij but when I try to create an executable war 
> file Struts fails to start.
> I have been using struts2-core:2.3.34, xwork-core:2.3.34 and 
> struts2-spring-plugin:2.3.34.
> Tomcat embedded starts normal and everything looks good but when I call a 
> page, struts try to start the dispatcher and it fails. I've created a small 
> project to reproduce that error and it can found 
> [https://github.com/GeorgeBarbosa/spring-boot-struts2].
> In addiction, there are no duplicate jars in my classpath.
> Please, is it a error in Struts or something else? What should I do to get 
> struts2 working in tomcat embedded?
> Error:
> {noformat}
> 2017-12-06 14:48:05.688  INFO 11440 --- [nio-8080-exec-1] 
> c.o.x.c.p.XmlConfigurationProvider       : Parsing configuration file 
> [struts-default.xml]
> 2017-12-06 14:48:05.861 ERROR 11440 --- [nio-8080-exec-1] 
> o.apache.struts2.dispatcher.Dispatcher   : Dispatcher initialization failed
> com.opensymphony.xwork2.config.ConfigurationException: Unable to load 
> configuration.
>         at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978) 
> ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) 
> ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
>  [struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.ng.servlet.StrutsServlet.init(StrutsServlet.java:54)
>  [struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:795) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [na:1.8.0_131]
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_131]
>         at 
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
> Caused by: com.opensymphony.xwork2.config.ConfigurationException: Unable to 
> load bean: type: class:com.opensymphony.xwork2.ObjectFactory
>         at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:247)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:240)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         ... 23 common frames omitted
> Caused by: com.opensymphony.xwork2.config.ConfigurationException: Bean type 
> class com.opensymphony.xwork2.ObjectFactory with the name struts has already 
> been loaded by bean - 
> jar:file:/C:/workspaces/workspace/pessoal/spring-boot-struts2/target/spring-boot-struts2-0.0.1-SNAPSHOT.war!/WEB-INF/lib/struts2-core-2.3.34.jar!/struts-default.xml:65:72
>         at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:231)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         ... 26 common frames omitted
> 2017-12-06 14:48:05.873 ERROR 11440 --- [nio-8080-exec-1] 
> o.a.c.c.C.[Tomcat].[localhost].[/]       : StandardWrapper.Throwable
> org.apache.struts2.StrutsException: null
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:504) 
> ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.ng.servlet.StrutsServlet.init(StrutsServlet.java:54)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:795) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [na:1.8.0_131]
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_131]
>         at 
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
> Caused by: com.opensymphony.xwork2.config.ConfigurationException: Unable to 
> load configuration.
>         at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978) 
> ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) 
> ~[struts2-core-2.3.34.jar!/:2.3.34]
>         ... 20 common frames omitted
> Caused by: com.opensymphony.xwork2.config.ConfigurationException: Unable to 
> load bean: type: class:com.opensymphony.xwork2.ObjectFactory
>         at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:247)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:240)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         ... 23 common frames omitted
> Caused by: com.opensymphony.xwork2.config.ConfigurationException: Bean type 
> class com.opensymphony.xwork2.ObjectFactory with the name struts has already 
> been loaded by bean - 
> jar:file:/C:/workspaces/workspace/pessoal/spring-boot-struts2/target/spring-boot-struts2-0.0.1-SNAPSHOT.war!/WEB-INF/lib/struts2-core-2.3.34.jar!/struts-default.xml:65:72
>         at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:231)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         ... 26 common frames omitted
> 2017-12-06 14:48:05.876 ERROR 11440 --- [nio-8080-exec-1] 
> .a.c.c.C.[.[.[.[.g.s.c.SBSStrutsServlet] : Allocate exception for servlet 
> com.gbarbosa.sbs.config.SBSStrutsServlet
> com.opensymphony.xwork2.config.ConfigurationException: Bean type class 
> com.opensymphony.xwork2.ObjectFactory with the name struts has already been 
> loaded by bean - 
> jar:file:/C:/workspaces/workspace/pessoal/spring-boot-struts2/target/spring-boot-struts2-0.0.1-SNAPSHOT.war!/WEB-INF/lib/struts2-core-2.3.34.jar!/struts-default.xml:65:72
>         at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:231)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:240)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
>  ~[xwork-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978) 
> ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) 
> ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.struts2.dispatcher.ng.servlet.StrutsServlet.init(StrutsServlet.java:54)
>  ~[struts2-core-2.3.34.jar!/:2.3.34]
>         at 
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
>  ~[tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:795) 
> ~[tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
>  ~[tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) 
> [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [na:1.8.0_131]
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_131]
>         at 
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>  [tomcat-embed-core-8.5.14.jar!/:8.5.14]
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to