3 Replies Latest reply on Jan 25, 2010 6:53 PM by jschellSomeoneStoleMyAlias

    hibernate does not work with weblogic 10

    843859
      I am trying to get hibernate jpa provider working with weblogic 10, after weeks of searching I have not been able to get it working,
      here is persistence.xml inside meta-inf

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
      version="1.0">

      <persistence-unit name="MaestroJPA_RL" transaction-type="RESOURCE_LOCAL">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>MaestroDS</jta-data-source>
      <properties>
      <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
      <property name="hibernate.show_sql" value="false" />
      <property name="hibernate.max_fetch_depth" value="0" />
      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup" />
      <property name="hibernate.format_sql" value="false" />
      </properties>
      </persistence-unit>

      </persistence>



      here are the jars included in the ear:

      activation-j2ee-5.2.jar
      ant-1.6.5.jar
      ant-antlr-1.6.5.jar
      ant-junit-1.6.5.jar
      ant-launcher-1.6.5.jar
      antlr-2.7.6.jar
      ant-swing-1.6.5.jar
      aopalliance.jar
      api.jar
      asm.jar
      asm-attrs.jar
      axiom-api-1.2.8.jar
      axiom-dom-1.2.8.jar
      axiom-impl-1.2.8.jar
      axis2-adb-1.5.jar
      axis2-adb-codegen-1.5.jar
      axis2-ant-plugin-1.5.jar
      axis2-clustering-1.5.jar
      axis2-codegen-1.5.jar
      axis2-corba-1.5.jar
      axis2-fastinfoset-1.5.jar
      axis2-java2wsdl-1.5.jar
      axis2-jaxbri-1.5.jar
      axis2-jaxws-1.5.jar
      axis2-jibx-1.5.jar
      axis2-json-1.5.jar
      axis2-kernel-1.5.jar
      axis2-metadata-1.5.jar
      axis2-mtompolicy-1.5.jar
      axis2-saaj-1.5.jar
      axis2-spring-1.5.jar
      axis2-transport-http-1.5.jar
      axis2-transport-local-1.5.jar
      axis2-xmlbeans-1.5.jar
      b1base.jar
      b1oracle.jar
      b1resource.jar
      b1util.jar
      c3p0-0.9.1.jar
      cglib-2.1.3.jar
      checkstyle-all.jar
      classes12-10g.2.0.4.jar
      cleanimports.jar
      commons-beanutils.jar
      commons-beanutils-bean-collections.jar
      commons-beanutils-core.jar
      commons-collections-3.1.jar
      commons-configuration-1.2.jar
      commons-dbcp-1.2.2.jar
      commons-httpclient-3.1.jar
      commons-lang-2.1.jar
      commons-logging.jar
      commons-logging.properties
      commons-logging-api.jar
      commons-pool-1.4.jar
      concurrent-1.3.2.jar
      connector.jar
      dom4j.jar
      ehcache-1.2.3.jar
      ejb3-persistence.jar
      guice-1.0.jar
      hibernate3.3.1.jar
      hibernate-annotations-3.3.0.jar
      hibernate-commons-annotations.jar
      hibernate-core.jar
      hibernate-entitymanager-3.3.1.jar
      hibernate-tools.jar
      hibernate-validator-3.1.0.jar
      hsd_xmlbeans.jar
      IspService-test-client.jar
      jaas.jar
      jacc-1_0-fr.jar
      javaee-api-5.jar
      javassist.jar
      javazoom-jl-1.0.jar
      jaxb-api.jar
      jaxb-impl.jar
      jaxb-xjc.jar
      jaxen-1.1-beta-7.jar
      jaxws-api.jar
      jaxws-rt.jar
      jaxws-tools.jar
      jboss-archive-browsing.jar
      jboss-cache.jar
      jboss-common.jar
      jboss-jmx.jar
      jboss-system.jar
      jdbc2_0-stdext.jar
      jgroups-2.2.8.jar
      jms.jar
      jsr173_1.0_api.jar
      jta.jar
      junit-4.5.jar
      log4j.properties
      log4j-1.2.15.jar
      lucene-core-2.3.0.jar
      oscache-2.1.jar
      proxool-0.8.3.jar
      resolver.jar
      slf4j-api.jar
      slf4j-simple-1.5.2.jar
      spring.jar
      swarmcache-1.0rc2.jar
      syndiag2.jar
      versioncheck.jar
      wls-api.jar
      xbean.jar
      xbean_isp_servlet.jar
      xbean_xpath.jar
      XBeans-packaged.jar
      xerces-2.6.2.jar
      xml-apis.jar
      xmlbeans-qname.jar
      xmlpublic.jar
      xstream-1.3.1.jar


      I have this in weblogic-application.xml

      </wls:application-param>
      <wls:prefer-application-packages>
      <wls:package-name>antlr.*</wls:package-name>
      <wls:package-name>org.apache.log4j.*</wls:package-name>
      <wls:package-name>org.apache.commons.*</wls:package-name>
      <wls:package-name>org.apache.oro.*</wls:package-name>
      <wls:package-name>oracle.*</wls:package-name>
      </wls:prefer-application-packages>


      the jpa classes are included in a stateless ejb but the jpa code is not an ejb (or injected )
      it is implemented as a resource local,

      If I use openjpa built into weblogic everything work just fine, its only when I switch to hibernate - because thats what they want :( that it does not work , it seems no matter what combination of jars I have
        • 1. Re: hibernate does not work with weblogic 10
          jschellSomeoneStoleMyAlias
          that it does not work
          That tells us nothing. What do the logs report?
          • 2. Re: hibernate does not work with weblogic 10
            843859
            [ERROR][com.mcc.maestro.services.om.OrderManagementEJB][getCustomerByBillingSystemAccountNumber][04:40:42:PM][java.lang.ExceptionInInitializerError
                 at com.mcc.maestro.services.om.utils.CustomerHelper.getCustomerByBillingSystemAccountNumber(Unknown Source)
                 at com.mcc.maestro.services.om.OrderManagementEJB.getCustomerByBillingSystemAccountNumber(Unknown Source)
            ..........
                 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
                 at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
            Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named MaestroJPA_RL
                 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
                 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
                 at com.mcc.maestro.persistence.Database.setupEntityManagerFactory(Unknown Source)
                 at com.mcc.maestro.persistence.Database.getEntityManagerWithOutTransaction(Unknown Source)
                 at com.mcc.maestro.persistence.Database.getProductCatalogs(Unknown Source)
                 at com.mcc.maestro.services.om.utils.OrderManagementTools.<clinit>(Unknown Source)
                 ... 44 more
            ]
            [ERROR][jsp_servlet._console.__viewcustomerhistory][_jspService][04:40:42:PM][javax.ejb.EJBException: nested exception is: com.mcc.maestro.services.om.OrderManagementException: java.lang.ExceptionInInitializerError
            com.mcc.maestro.services.om.OrderManagementException: java.lang.ExceptionInInitializerError
                 at com.mcc.maestro.services.om.OrderManagementEJB.getCustomerByBillingSystemAccountNumber(Unknown Source)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
                 at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
                 at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
                 at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
                 at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
                 at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
                 at weblogic.ejb.container.injection.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:68)
                 at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
                 at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
                 at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
                 at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
                 at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
                 at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
                 at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
                 at $Proxy322.getCustomerByBillingSystemAccountNumber(Unknown Source)
                 at com.mcc.maestro.services.om.OrderManagementEJB_8tngtk_OrderManagementEJBRemoteImpl.getCustomerByBillingSystemAccountNumber(OrderManagementEJB_8tngtk_OrderManagementEJBRemoteImpl.java:6530)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:63)
                 at $Proxy318.getCustomerByBillingSystemAccountNumber(Unknown Source)
                 at jsp_servlet._console.__viewcustomerhistory._jspService(__viewcustomerhistory.java:884)
                 at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
                 at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
                 at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
                 at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
                 at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:394)
                 at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:309)
                 at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
                 at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3395)
                 at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                 at weblogic.security.service.SecurityManager.runAs(Unknown Source)
                 at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
                 at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
                 at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
                 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
                 at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
            Caused by: java.lang.ExceptionInInitializerError
                 at com.mcc.maestro.services.om.utils.CustomerHelper.getCustomerByBillingSystemAccountNumber(Unknown Source)
                 ... 43 more
            Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named MaestroJPA_RL
                 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
                 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
                 at com.mcc.maestro.persistence.Database.setupEntityManagerFactory(Unknown Source)
                 at com.mcc.maestro.persistence.Database.getEntityManagerWithOutTransaction(Unknown Source)
                 at com.mcc.maestro.persistence.Database.getProductCatalogs(Unknown Source)
                 at com.mcc.maestro.services.om.utils.OrderManagementTools.<clinit>(Unknown Source)
                 ... 44 more
            javax.ejb.EJBException: nested exception is: com.mcc.maestro.services.om.OrderManagementException: java.lang.ExceptionInInitializerError
                 at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:78)
                 at $Proxy318.getCustomerByBillingSystemAccountNumber(Unknown Source)
                 at jsp_servlet._console.__viewcustomerhistory._jspService(__viewcustomerhistory.java:884)
                 at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
                 at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
            • 3. Re: hibernate does not work with weblogic 10
              jschellSomeoneStoleMyAlias
              java.lang.ExceptionInInitializerError
              That particular error occurs because a static initializer threw an exception.