java - Bean already registered - struts2-core dependency error -


i'm trying migrate project maven , declare struts2 dependencies, i'm stuck @ error. double-checked pom.xml dependencies, made sure struts2-core declared once, added exclusions , all. tried , without xwork-core dependency, same error. literally stuck , don't know how proceed here. error:

15:35:29,079 info  [com.opensymphony.xwork2.config.providers.xmlconfigurationprovider] (serverservice thread pool -- 72) parsing configuration file [struts-default.xml]     15:35:29,124 error [org.apache.struts2.dispatcher.dispatcher] (serverservice thread pool -- 72) dispatcher initialization failed: unable load configuration. - bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.jar/struts-default.xml:40:72         @ com.opensymphony.xwork2.config.configurationmanager.getconfiguration(configurationmanager.java:70) [xwork-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.dispatcher.init_preloadconfiguration(dispatcher.java:445) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.dispatcher.init(dispatcher.java:489) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.ng.initoperations.initdispatcher(initoperations.java:74) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter.init(strutsprepareandexecutefilter.java:57) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.catalina.core.applicationfilterconfig.getfilter(applicationfilterconfig.java:416) [jbossweb-7.2.0.final-redhat-1.jar:7.2.0.final-redhat-1]         @ org.apache.catalina.core.standardcontext.filterstart(standardcontext.java:3225) [jbossweb-7.2.0.final-redhat-1.jar:7.2.0.final-redhat-1]         @ org.apache.catalina.core.standardcontext.start(standardcontext.java:3791) [jbossweb-7.2.0.final-redhat-1.jar:7.2.0.final-redhat-1]         @ org.jboss.as.web.deployment.webdeploymentservice.dostart(webdeploymentservice.java:156) [jboss-as-web-7.2.0.final-redhat-8.jar:7.2.0.final-redhat-8]         @ org.jboss.as.web.deployment.webdeploymentservice.access$000(webdeploymentservice.java:60) [jboss-as-web-7.2.0.final-redhat-8.jar:7.2.0.final-redhat-8]         @ org.jboss.as.web.deployment.webdeploymentservice$1.run(webdeploymentservice.java:93) [jboss-as-web-7.2.0.final-redhat-8.jar:7.2.0.final-redhat-8]         @ java.util.concurrent.executors$runnableadapter.call(executors.java:441) [rt.jar:1.6.0_13]         @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:303) [rt.jar:1.6.0_13]         @ java.util.concurrent.futuretask.run(futuretask.java:138) [rt.jar:1.6.0_13]         @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:886) [rt.jar:1.6.0_13]         @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:908) [rt.jar:1.6.0_13]         @ java.lang.thread.run(thread.java:619) [rt.jar:1.6.0_13]         @ org.jboss.threads.jbossthread.run(jbossthread.java:122)     caused by: unable load bean: type: class:com.opensymphony.xwork2.objectfactory - bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.jar/struts-default.xml:40:72         @ com.opensymphony.xwork2.config.providers.xmlconfigurationprovider.register(xmlconfigurationprovider.java:245) [xwork-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.config.strutsxmlconfigurationprovider.register(strutsxmlconfigurationprovider.java:102) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ com.opensymphony.xwork2.config.impl.defaultconfiguration.reloadcontainer(defaultconfiguration.java:234) [xwork-core-2.3.16.3.jar:2.3.16.3]         @ com.opensymphony.xwork2.config.configurationmanager.getconfiguration(configurationmanager.java:67) [xwork-core-2.3.16.3.jar:2.3.16.3]         ... 17 more     caused by: bean type class com.opensymphony.xwork2.objectfactory name struts has been loaded bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.3.jar/struts-default.xml:40:72 - bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.jar/struts-default.xml:40:72         @ com.opensymphony.xwork2.config.providers.xmlconfigurationprovider.register(xmlconfigurationprovider.java:229) [xwork-core-2.3.16.3.jar:2.3.16.3]         ... 20 more      15:35:29,134 error [org.apache.catalina.core.containerbase.[jboss.web].[default-host].[/fordaq]] (serverservice thread pool -- 72) jbweb000284: exception starting filter struts: unable load configuration. - bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.jar/struts-default.xml:40:72         @ org.apache.struts2.dispatcher.dispatcher.init(dispatcher.java:501) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.ng.initoperations.initdispatcher(initoperations.java:74) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter.init(strutsprepareandexecutefilter.java:57) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.catalina.core.applicationfilterconfig.getfilter(applicationfilterconfig.java:416) [jbossweb-7.2.0.final-redhat-1.jar:7.2.0.final-redhat-1]         @ org.apache.catalina.core.standardcontext.filterstart(standardcontext.java:3225) [jbossweb-7.2.0.final-redhat-1.jar:7.2.0.final-redhat-1]         @ org.apache.catalina.core.standardcontext.start(standardcontext.java:3791) [jbossweb-7.2.0.final-redhat-1.jar:7.2.0.final-redhat-1]         @ org.jboss.as.web.deployment.webdeploymentservice.dostart(webdeploymentservice.java:156) [jboss-as-web-7.2.0.final-redhat-8.jar:7.2.0.final-redhat-8]         @ org.jboss.as.web.deployment.webdeploymentservice.access$000(webdeploymentservice.java:60) [jboss-as-web-7.2.0.final-redhat-8.jar:7.2.0.final-redhat-8]         @ org.jboss.as.web.deployment.webdeploymentservice$1.run(webdeploymentservice.java:93) [jboss-as-web-7.2.0.final-redhat-8.jar:7.2.0.final-redhat-8]         @ java.util.concurrent.executors$runnableadapter.call(executors.java:441) [rt.jar:1.6.0_13]         @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:303) [rt.jar:1.6.0_13]         @ java.util.concurrent.futuretask.run(futuretask.java:138) [rt.jar:1.6.0_13]         @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:886) [rt.jar:1.6.0_13]         @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:908) [rt.jar:1.6.0_13]         @ java.lang.thread.run(thread.java:619) [rt.jar:1.6.0_13]         @ org.jboss.threads.jbossthread.run(jbossthread.java:122)     caused by: unable load configuration. - bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.jar/struts-default.xml:40:72         @ com.opensymphony.xwork2.config.configurationmanager.getconfiguration(configurationmanager.java:70) [xwork-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.dispatcher.init_preloadconfiguration(dispatcher.java:445) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.dispatcher.dispatcher.init(dispatcher.java:489) [struts2-core-2.3.16.3.jar:2.3.16.3]         ... 15 more     caused by: unable load bean: type: class:com.opensymphony.xwork2.objectfactory - bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.jar/struts-default.xml:40:72         @ com.opensymphony.xwork2.config.providers.xmlconfigurationprovider.register(xmlconfigurationprovider.java:245) [xwork-core-2.3.16.3.jar:2.3.16.3]         @ org.apache.struts2.config.strutsxmlconfigurationprovider.register(strutsxmlconfigurationprovider.java:102) [struts2-core-2.3.16.3.jar:2.3.16.3]         @ com.opensymphony.xwork2.config.impl.defaultconfiguration.reloadcontainer(defaultconfiguration.java:234) [xwork-core-2.3.16.3.jar:2.3.16.3]         @ com.opensymphony.xwork2.config.configurationmanager.getconfiguration(configurationmanager.java:67) [xwork-core-2.3.16.3.jar:2.3.16.3]         ... 17 more     caused by: bean type class com.opensymphony.xwork2.objectfactory name struts has been loaded bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.3.jar/struts-default.xml:40:72 - bean - vfs:/c:/servers/jboss-eap-6.1/standalone/deployments/war.war/web-inf/lib/struts2-core-2.3.16.jar/struts-default.xml:40:72         @ com.opensymphony.xwork2.config.providers.xmlconfigurationprovider.register(xmlconfigurationprovider.java:229) [xwork-core-2.3.16.3.jar:2.3.16.3]         ... 20 more 

pom.xml dependencies:

dependency>     <groupid>org.apache.struts</groupid>     <artifactid>struts2-json-plugin</artifactid>     <version>2.3.16</version> </dependency>  <dependency>     <groupid>org.apache.struts</groupid>     <artifactid>struts2-spring-plugin</artifactid>     <version>2.3.16</version> </dependency>  <dependency>     <groupid>org.apache.struts</groupid>     <artifactid>struts2-struts1-plugin</artifactid>     <version>2.3.16</version>     <exclusions>         <exclusion>             <artifactid>struts2-core</artifactid>             <groupid>org.apache.struts</groupid>         </exclusion>     </exclusions> </dependency> 

any appreciated!

first need add struts2-core artifact , test if works, add spring and/or other plugins. see how create struts 2 web application using maven manage artifacts , build application.

the pom.xml core struts2 application requires only

<dependency>     <groupid>org.apache.struts</groupid>     <artifactid>struts2-core</artifactid>     <version>x.x.x.x</version> </dependency> 

where x.x.x.x concrete version, i.e. 2.3.16.3 or 2.3.24.1, , download other dependencies. integrating other frameworks use plugins , don't mess dependencies duplicated. clean, rebuild, redeploy. check web-inf/lib should not contain duplicate libraries different versions. in case struts2-core-2.3.16.3.jar , struts2-core-2.3.16.jar both loaded on classpath. error, there should not same library of 2 different versions.

you use other plugins

<dependency>     <groupid>org.apache.struts</groupid>     <artifactid>struts2-json-plugin</artifactid>     <version>2.3.16.3</version> </dependency>  <dependency>     <groupid>org.apache.struts</groupid>     <artifactid>struts2-spring-plugin</artifactid>     <version>2.3.16.3</version> </dependency>  <dependency>     <groupid>org.apache.struts</groupid>     <artifactid>struts2-struts1-plugin</artifactid>     <version>2.3.16.3</version> </dependency> 

that added pom.xml.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -