title: Weblogic, beans aren't found by Spring
body: <p>We have a web application that uses Spring 3. And we have to migrate it from Tomcat 7 to Weblogic 10.</p>
  
  <p>The structure of this application is:</p>
  
  <ul>
  <li>a core module, which contains all the application logic. This module is packaged as a jar.</li>
  <li>a web module, which defines all the web services. This module includes the previous one as a dependency and uses its beans by including the core-module context in the 'contextConfigLocation' param.</li>
  </ul>
  
  <p>I'm using maven and this is how the dependency is defined in the web-module:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;module-core&lt;/artifactId&gt;
      &lt;version&gt;${project.version}&lt;/version&gt;
      &lt;classifier&gt;${environment}&lt;/classifier&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The application worked fine in tomcat, but it can't be deploied in Weblogic since Spring can't create any bean that depends on beans in core-module.jar. The error is always the same for all the beans comming from core-module: </p>
  
  <pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxxBean' is defined
  </code></pre>
  
  <p>'xxxBean' is any of the bean defined in core-module.jar. If I delete the ref to avoid the problem with that bean, the next referenced bean will provoke the error again. I mean Spring finds all the beans defined in web-module itself, but none defined in core-module.</p>
  
  <p>In the trace of the error, I can see that weblogic is using this:</p>
  
  <pre><code>com.oracle.weblogic.wsee.wrapper.org.springframework.web.context.ContextLoaderListener.contextInitialized
  </code></pre>
  
  <p>so the problem may be related to the wrapper that Weblogic introduces for spring applications.</p>
  
  <p>Any idea about the configuration that can fix this problem? Thanks!</p>