title: java.lang.ClassNotFoundException: org.springframework.beans.factory.access.BeanFactoryReference
body: <p>After a long search and no answer to my case, here I am.
  Trying to deploy a "Struts 2 + Maven + Spring" WAR project into Wildfly 11, using Eclipse Oxigen's default to all.</p>
  
  <p>The stack is as it follows:</p>
  
  <pre><code>15:04:27,325 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "MSDB.war" (runtime-name: "MSDB.war")
  15:04:30,148 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."MSDB.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MSDB.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "MSDB.war"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.springframework.web.context.ContextLoader with ClassLoader ModuleClassLoader for Module "deployment.MSDB.war" from Service Module Loader
      at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
      at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
      at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
      at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
      at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
      ... 5 more
  Caused by: java.lang.NoClassDefFoundError: Lorg/springframework/beans/factory/access/BeanFactoryReference;
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Unknown Source)
      at java.lang.Class.getDeclaredFields(Unknown Source)
      at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.&lt;init&gt;(ClassReflectionIndex.java:72)
      at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
      ... 10 more
  Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.access.BeanFactoryReference from [Module "deployment.MSDB.war" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      ... 15 more
  
  15:04:30,150 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 4) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" =&gt; "MSDB.war")]) - failure description: {"WFLYCTL0080: Failed services" =&gt; {"jboss.deployment.unit.\"MSDB.war\".POST_MODULE" =&gt; "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"MSDB.war\"
      Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.springframework.web.context.ContextLoader with ClassLoader ModuleClassLoader for Module \"deployment.MSDB.war\" from Service Module Loader
      Caused by: java.lang.NoClassDefFoundError: Lorg/springframework/beans/factory/access/BeanFactoryReference;
      Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.access.BeanFactoryReference from [Module \"deployment.MSDB.war\" from Service Module Loader]"}}
  15:04:30,151 ERROR [org.jboss.as.server] (External Management Request Threads -- 4) WFLYSRV0021: Deploy of deployment "MSDB.war" was rolled back with the following failure message: 
  {"WFLYCTL0080: Failed services" =&gt; {"jboss.deployment.unit.\"MSDB.war\".POST_MODULE" =&gt; "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"MSDB.war\"
      Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.springframework.web.context.ContextLoader with ClassLoader ModuleClassLoader for Module \"deployment.MSDB.war\" from Service Module Loader
      Caused by: java.lang.NoClassDefFoundError: Lorg/springframework/beans/factory/access/BeanFactoryReference;
      Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.access.BeanFactoryReference from [Module \"deployment.MSDB.war\" from Service Module Loader]"}}
  15:04:30,268 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment MSDB.war (runtime-name: MSDB.war) in 116ms
  </code></pre>
  
  <p>pom.xml is currently like this (after inserting a lot of extra dependencies, from tries from previous searches on the web):</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" mlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;SBMC&lt;/groupId&gt;
  &lt;artifactId&gt;MSDB&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;MSDB&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;3.8.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&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.34&lt;/version&gt;
      &lt;/dependency&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.16.2&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;5.0.0.RELEASE&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;5.0.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-expression&lt;/artifactId&gt;
          &lt;version&gt;5.0.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
          &lt;version&gt;5.0.0.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;5.0.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;3.6.3.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.9&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;finalName&gt;MSDB&lt;/finalName&gt;
      &lt;plugins&gt;
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
          &lt;version&gt;5.0&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;!-- &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;configuration&gt;
              &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt; --&gt;
  &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I searched a lot, but nothing I found solved my issue.</p>