title: Spring app on Tomcat doesnt find class in weblogic.jar
body: <p>I'm trying to deploy an app on tomcat 7 that uses spring 3.1.1 and weblogic 10.3, but I keep getting a NoClassDef exception:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class weblogic.jndi.Environment at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
  </code></pre>
  
  <p>I've double checked and and the weblogic jar is present on WEB-INF/lib and it does contain said class: </p>
  
  <pre><code>jar tf WEB-INF/lib/weblogic.jar | grep /Environment.class
  weblogic/cluster/messaging/internal/Environment.class
  weblogic/jndi/Environment.class
  org/mozilla/javascript/tools/shell/Environment.class
  </code></pre>
  
  <p>this happens when a spring bean factory tries to build this bean on my root-context.xml</p>
  
  <pre><code>&lt;beans:bean
      id="jmsConnectionFactory"
      class="org.springframework.jndi.JndiObjectFactoryBean"
      p:jndiTemplate-ref="jndiTemplate"
      p:jndiName="weblogic.jms.ConnectionFactory" /&gt;
  </code></pre>
  
  <p>I thought it might be some classpath issue, but I have been playing around with the MANIFEST.MF of the webapp and this problematic jars(spring &amp; weblogic) for a while now,  without any luck.
  Any ideas on what can be causing this?</p>