rashmi106
rashmi106

Reputation: 21

struts2 and spring jdbc integration

i am trying to integrate the struts2 and spring for spring jdbc but its not working for me.... plzzz help in this....

i am doing this in eclipse indigo IDE and apache tomcat server 7.0.

please help as soon as possible

I am getting following exception in console

SEVERE: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/D:/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/strutsplusspring/WEB-INF/lib/struts2-core-2.2.3.1.jar!/struts-default.xml:29:72
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4624)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load configuration. - bean - jar:file:/D:/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/strutsplusspring/WEB-INF/lib/struts2-core-2.2.3.1.jar!/struts-default.xml:29:72
    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)
    ... 15 more
Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/D:/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/strutsplusspring/WEB-INF/lib/struts2-core-2.2.3.1.jar!/struts-default.xml:29:72
    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)
    ... 17 more
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/D:/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/strutsplusspring/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72 - bean - jar:file:/D:/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/strutsplusspring/WEB-INF/lib/struts2-core-2.2.3.1.jar!/struts-default.xml:29:72
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:205)
    ... 20 more

Upvotes: 0

Views: 1176

Answers (1)

Umesh Awasthi
Umesh Awasthi

Reputation: 23587

Seems that there is a conflict between 2 jars in your application and due to which Struts2 is unable to start is filter. looking at the log shows that you have 2 struts2-core jars in your class-path

struts2-core-2.2.3.1.jar
struts2-core-2.1.8.1.jar

Check your application class path for the same jar with multiple versions.

Upvotes: 1

Related Questions