title: java.lang.NoSuchMethodError: org.springframework.beans.support.ResourceEditorRegistrar.<init>
body: <p>Trying to integrate Spring 4.2.2.RELEASE with Struts2 2.3.24.1. I had tested that Spring was working by manually instantiating my Service class inside the action as</p>
  
  <pre><code>ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
  DbServicesHibernate dbServices = (DbServicesHibernate) context.getBean("dbServices");
  </code></pre>
  
  <p>Once that worked, I wanted that spring injected the dbServices dependency automatically by autowiring, so I added the struts2-spring-plugin 2.3.24.1 and modified web.xml. The resulting files and error stack trace being:</p>
  
  <p><strong>struts.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
      "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
  
  &lt;struts&gt;
  
      &lt;constant name="struts.devMode" value="true" /&gt;
  
      &lt;package name="issues" extends="struts-default"&gt;
  
          &lt;action name="GetCbtionList" class="coproject.cpweb.actions.GetCbtionList"&gt;
              &lt;result name="SUCCESS"&gt;/views/dummy.jsp&lt;/result&gt;
          &lt;/action&gt;
  
      &lt;/package&gt;
  
  &lt;/struts&gt;
  </code></pre>
  
  <p><strong>Action Class</strong></p>
  
  <pre><code>public class GetCbtionList extends ActionSupport{
  
      private static final long serialVersionUID = 1L;
  
      public String execute() throws Exception  {
  
          User user = new User();
          user.setFirstname("Jose");
          user.setPassword("iris");
  
          User user2 = new User();
          user2.setFirstname("Rosa");
          user2.setPassword("iras");
  
          dbServices.saveUser(user);
          dbServices.saveUser(user2);
  
          return "SUCCESS";
      }
  
      DbServicesIf dbServices;
  
      public DbServicesIf getDbServices() {
          return dbServices;
      }
  
      public void setDbServices(DbServicesIf dbServices) {
          this.dbServices = dbServices;
      }
  
  }
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!-- The web.xml, also known as the deployment descriptor, defines a Java Servlet web application. 
           This document is a mandatory element of any web application and must reside within WEB-INF.  The 
           deployment descriptor defines all the servlets and servlet filters that belong to this web
           application. --&gt;
  
  &lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  
      &lt;display-name&gt;CoProject&lt;/display-name&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;url-pattern&gt;/ *&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;views/issue_navigator_dum.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
       &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/beans.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>beans.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd"&gt;
  
      &lt;bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
         &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
         &lt;property name="url" value="jdbc:mysql://localhost:3306/test" /&gt;
         &lt;property name="username" value="jaof" /&gt;
         &lt;property name="password" value="iris" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="mySessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="myDataSource"/&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;coproject.cpweb.utils.db.entities.User&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.current_session_context_class"&gt;thread&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dbServices" class="coproject.cpweb.utils.db.services.DbServicesHibernate"&gt;
          &lt;property name="sessionFactory" ref="mySessionFactory"/&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>Maven Dependencies</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
              &lt;version&gt;7.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- STRUTS --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts2-core&lt;/artifactId&gt;
              &lt;version&gt;2.3.24.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- HIBERNATE --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;5.0.2.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.37&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- SPRING --&gt; 
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts2-spring-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.24.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;4.2.2.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;4.2.2.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;4.2.2.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  </code></pre>
  
  <p><strong>Stacktrace for error</strong></p>
  
  <pre><code>INFO: Initializing Spring root WebApplicationContext
  nov 22, 2015 4:51:24 PM org.springframework.web.context.ContextLoader initWebApplicationContext
  INFO: Root WebApplicationContext: initialization started
  nov 22, 2015 4:51:24 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
  INFO: Refreshing Root WebApplicationContext: startup date [Sun Nov 22 16:51:24 CET 2015]; root of context hierarchy
  nov 22, 2015 4:51:24 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/beans.xml]
  nov 22, 2015 4:51:25 PM org.springframework.web.context.ContextLoader initWebApplicationContext
  SEVERE: Context initialization failed
  java.lang.NoSuchMethodError: org.springframework.beans.support.ResourceEditorRegistrar.&lt;init&gt;(Lorg/springframework/core/io/ResourceLoader;Lorg/springframework/core/env/PropertyResolver;)V
      at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:622)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:512)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  
  nov 22, 2015 4:51:25 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  java.lang.NoSuchMethodError: org.springframework.beans.support.ResourceEditorRegistrar.&lt;init&gt;(Lorg/springframework/core/io/ResourceLoader;Lorg/springframework/core/env/PropertyResolver;)V
      at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:622)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:512)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I have been struggling with this integration for weeks, this time I though I was close but here I am, stuck once again... </p>
  
  <p>Any idea on what might be causing this? is it some sort of incompatibility among the different libraries?</p>