title: Hibernate, weblogic 12c deployment error
body: <p>I am trying to deploy a .war on weblogic 12c and I get the following error:
  weblogic console error :</p>
  
  <pre><code>An error occurred during activation of changes, please see the log for details. 
  Error org.hibernate.HibernateException: Errors in named queries: 
  getAuditTaskById, getAllAuditTasksByUser, getAllAuditTasks 
  Error Substituted for missing class org.hibernate.HibernateException - 
  Errors in named queries: getAuditTaskById, getAllAuditTasksByUser, getAllAuditTasks
  </code></pre>
  
  <p>I have tried to filter class path by changing weblogic.xml :</p>
  
  <pre><code>    &lt;container-descriptor&gt;
        &lt;!-- prefer-web-inf-classes&gt;true&lt;/prefer-web-inf-classes--&gt;
        &lt;prefer-web-inf-classes&gt;false&lt;/prefer-web-inf-classes&gt;   
      &lt;prefer-application-packages&gt;
        &lt;package-name&gt;org.hibernate.*&lt;/package-name&gt;
        &lt;package-name&gt;org.apache.*&lt;/package-name&gt;
        &lt;package-name&gt;antlr.*&lt;/package-name&gt;
      &lt;/prefer-application-packages&gt;
  
    &lt;/container-descriptor&gt;
  </code></pre>
  
  <p>I am using hinernate-commons-annotations-4.0.2.Final.jar, hibernate-core-4.2.12.Final.jar , hibernate-entitymanaget-4.2.12.Final.jar . Any suggestion will be appreciated. 
  Here is complete error log:</p>
  
  <pre><code>    &lt;Apr 22, 2015 3:29:19 PM IRDT&gt; &lt;Warning&gt; &lt;Deployer&gt; &lt;BEA-149004&gt; &lt;Failures were
  detected while initiating deploy task for application "benefits40".&gt;
  &lt;Apr 22, 2015 3:29:19 PM IRDT&gt; &lt;Warning&gt; &lt;Deployer&gt; &lt;BEA-149078&gt; &lt;Stack trace fo
  r message 149004
  weblogic.application.ModuleException: org.hibernate.HibernateException: Errors i
  n named queries: getAuditTaskById, getAllAuditTasksByUser, getAllAuditTasks
          at weblogic.application.internal.ExtensibleModuleWrapper.prepare(Extensi
  bleModuleWrapper.java:114)
          at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(Modu
  leListenerInvoker.java:100)
          at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleSta
  teDriver.java:175)
          at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleSta
  teDriver.java:170)
          at weblogic.application.utils.StateMachineDriver$ParallelChange.run(Stat
  eMachineDriver.java:80)
          Truncated. see log file for complete stacktrace
  Caused By: org.hibernate.HibernateException: Errors in named queries: getAuditTa
  skById, getAllAuditTasksByUser, getAllAuditTasks
          at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.j
  ava:532)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
  a:1797)
          at org.hibernate.ejb.EntityManagerFactoryImpl.&lt;init&gt;(EntityManagerFactor
  yImpl.java:96)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Con
  figuration.java:914)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Con
  figuration.java:899)
          Truncated. see log file for complete stacktrace
  &gt;
  &lt;Apr 22, 2015 3:29:19 PM IRDT&gt; &lt;Error&gt; &lt;Console&gt; &lt;BEA-240003&gt; &lt;Administration Co
  nsole encountered the following error: weblogic.application.ModuleException: org
  .hibernate.HibernateException: Errors in named queries: getAuditTaskById, getAll
  AuditTasksByUser, getAllAuditTasks
          at weblogic.application.internal.ExtensibleModuleWrapper.prepare(Extensi
  bleModuleWrapper.java:114)
          at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(Modu
  leListenerInvoker.java:100)
          at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleSta
  teDriver.java:175)
          at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleSta
  teDriver.java:170)
          at weblogic.application.utils.StateMachineDriver$ParallelChange.run(Stat
  eMachineDriver.java:80)
          at weblogic.work.ContextWrap.run(ContextWrap.java:40)
          at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
  gWorkManagerImpl.java:548)
          at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
          at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
  Caused by: java.lang.Throwable: Substituted for missing class org.hibernate.Hibe
  rnateException - Errors in named queries: getAuditTaskById, getAllAuditTasksByUs
  er, getAllAuditTasks
          at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.j
  ava:532)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
  a:1797)
          at org.hibernate.ejb.EntityManagerFactoryImpl.&lt;init&gt;(EntityManagerFactor
  yImpl.java:96)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Con
  figuration.java:914)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Con
  figuration.java:899)
          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFa
  ctory(HibernatePersistence.java:76)
          at weblogic.persistence.BasePersistenceUnitInfo.initializeEntityManagerF
  actory(BasePersistenceUnitInfo.java:461)
          at weblogic.persistence.BasePersistenceUnitInfo.initializeEntityManagerF
  actory(BasePersistenceUnitInfo.java:454)
          at weblogic.persistence.BasePersistenceUnitInfo.init(BasePersistenceUnit
  Info.java:141)
          at weblogic.persistence.BaseJPAIntegrationProvider.createPersistenceUnit
  Info(BaseJPAIntegrationProvider.java:54)
          at weblogic.persistence.AbstractPersistenceUnitRegistry.storeDescriptors
  (AbstractPersistenceUnitRegistry.java:423)
          at weblogic.persistence.AbstractPersistenceUnitRegistry.loadPersistenceD
  escriptors(AbstractPersistenceUnitRegistry.java:130)
          at weblogic.persistence.ModulePersistenceUnitRegistry.&lt;init&gt;(ModulePersi
  stenceUnitRegistry.java:61)
          at weblogic.servlet.internal.WebAppInternalModuleExtension$PersistenceEx
  tension.setupPersistenceUnitRegistry(WebAppInternalModuleExtension.java:267)
          at weblogic.servlet.internal.WebAppInternalModuleExtension$PersistenceEx
  tension.access$400(WebAppInternalModuleExtension.java:188)
          at weblogic.servlet.internal.WebAppInternalModuleExtension.prePrepare(We
  bAppInternalModuleExtension.java:58)
          at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateCha
  nge.next(ExtensibleModuleWrapper.java:293)
          at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateCha
  nge.next(ExtensibleModuleWrapper.java:285)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
  river.java:42)
          at weblogic.application.internal.ExtensibleModuleWrapper.prepare(Extensi
  bleModuleWrapper.java:109)
  &gt;
  </code></pre>