title: Weblogic : Spring application context loading fails : Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()
body: <p>I have an MDB which listens on a JMS Queue, In the onMessage() i need to call a spring bean for which i am using SpringBeanAutowiringInterceptor.</p>
  
  <p>As i post message into the JMS Queue, the MDB is actually trying to load the spring application context but fails with the following error.</p>
  
  <pre><code>Caused By: org.springframework.beans.factory.access.BootstrapException: 
  Unable to     initialize group definition. Group resource name [classpath*:beanRefContext.xml], 
  factory key [null]; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'parentBeanFactory' defined in URL 
  [zip:C:/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/factoryadaptor-1.0.0-api/4f4fxo/war/WEB-INF/lib/_wl_cls_gen.jar!/beanRefContext.xml]: 
  Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: 
  Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: 
  Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'localEntityManagerFactory' defined in class path      resource [beans/applicationContext-db.xml]: Invocation of init method failed; 
  nested exception is java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
  </code></pre>
  
  <p>The excerpt of Applicationcontext-db.xml </p>
  
  <pre><code> &lt;tx:annotation-driven transaction-manager="jpaTransactionManager" /&gt;
  
   &lt;bean id="jpaTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" &gt;
      &lt;property name="entityManagerFactory" ref="localEntityManagerFactory" /&gt;
  &lt;/bean&gt;
  
  
  
  &lt;bean id="localEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
       &lt;property name="persistenceUnitName" value="DMS" /&gt;    
       &lt;property name="persistenceXmlLocation" value="classpath*:config/persistence1.xml" /&gt;
  &lt;/bean&gt; 
  
  &lt;bean id="entityManager" class="org.springframework.orm.jpa.support.SharedEntityManagerBean"&gt;
        &lt;property name="entityManagerFactory" ref="localEntityManagerFactory" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The excerpt of pom.xml is as below</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;3.2.3.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;3.2.3.RELEASE&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;3.2.3.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
          &lt;version&gt;3.2.3.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;3.2.3.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
          &lt;version&gt;3.2.3.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
          &lt;version&gt;3.2.3.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.11&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit-dep&lt;/artifactId&gt;
          &lt;version&gt;4.11&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
          &lt;version&gt;1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.oracle&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc5&lt;/artifactId&gt;
          &lt;version&gt;11.2.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
          &lt;version&gt;4.3.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>As i see in the eclipse dependency hierarchy for hibernate-entitymanager-4.3.0.Final.jar includes hibernate-jpa-2.1-api.jar. </p>
  
  <p>The same configuration works well when tried as Junit for intercating with DB. As i deploy the war in weblogic 12c, i am facing the above mentioned issue.</p>
  
  <p>Did anyone face the similar issue?</p>