2 Replies Latest reply on Sep 22, 2010 3:16 AM by Peter Varga

    Unrecognized persistence provider

    Chris Simons Expert

      All,


      Having difficulty setting up my entityManager and entityManagerFactory on Weblogic here.


      Here is the message I am receiving when on deployment:



      WARNING: Found unrecognized persistence provider org.hibernate.ejb.HibernatePersistence in place of OpenJPA provider.  This provider's properties will not be used.


      This only appears as a warning.  When I hit my application's homepage, I am receiving JDNI lookup issues around my EJBs, even though I've declared them in my ejb-jar.xml and web.xml files.  I've gotten the Seam JEE5 examples to deploy on Weblogic11; so I'm struggling to see what I'm doing wrong here.  Thanks.



      Here is the relevant portion of my components.xml:


      <!-- WEBLOGIC OVERRIDE FOR COMPONENTS.XML -->
         <!--<core:init debug="#{debug}" jndi-pattern="java:comp/env/#{project.name}/local"/>-->
          <core:init jndi-pattern="java:/englinkLocal/#{ejbName}/local" debug="true"/>
      
         <!--<transaction:ejb-transaction/>-->
           
         <core:manager concurrent-request-timeout="10000" 
                      conversation-timeout="360000" 
                      conversation-id-parameter="cid"/>
      
         <navigation:pages http-port="7001" https-port="7002"/>
      
         <!--<persistence:entity-manager-factory name="entityManagerFactory"-->
              <!--persistence-unit-name="#{project.name}"-->
              <!--auto-create="true"/>-->
      
         <persistence:entity-manager-factory name="englinkLocal"/>
      
          <persistence:managed-persistence-context name="entityManager"
                     auto-create="true"
                     entity-manager-factory="#{englinkLocal}"
                      persistence-unit-jndi-name="java:/englinkLocal/entityManagerFactory"/>



      Here is the relevant portion of my persistence.xml:



       <persistence-unit name="englinkLocal">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>wls-local-ds</jta-data-source>
            <properties>
               <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
               <property name="hibernate.show_sql" value="true"/>
      
               <property name="hibernate.cache.use_query_cache" value="true"/>
                <property name="hibernate.use_second_level_cache" value="false"/>
                       <!-- 
                       <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
               -->
               
               <!-- <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>  -->
               <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
      
               <property name="jboss.entity.manager.factory.jndi.name" value="java:/englinkLocal/entityManagerFactory"/>
               <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
      
      
              <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>
      
                       <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.DefaultComponentSafeNamingStrategy"/>




        • 1. Re: Unrecognized persistence provider
          shane lee Newbie

          Hi Chris,


          ive also got this problem deploying seam application on weblogic. I believe this is a serious issue. The problem is around setting up JTA as transaction manager.



          First:


          <property name="jboss.entity.manager.factory.jndi.name" value="java:/englinkLocal/entityManagerFactory"/>

          cannot not be used as persistent unit jndi name only applicable for jboss.


          My components.xml looks like this:



          <persistence:managed-persistence-context name="entityManager"
             auto-create="true"
             entity-manager-factory="#{wsRepositoryEntityManagerFactory}"/>
          
             <persistence:entity-manager-factory name="wsRepositoryEntityManagerFactory"
             persistence-unit-name="EbusinessHibernate"/>
             
             <transaction:ejb-transaction /> 



          persistence.xml is:



          <persistence-unit name="EbusinessHibernate" transaction-type="JTA">
                <provider>org.hibernate.ejb.HibernatePersistence</provider>
                <jta-data-source>EbusinessHibernateDatasource</jta-data-source>
                <properties>
                   <property name="hibernate.dialect" value="ebusiness.weblogic.dialect.InformixDialect"/>
                   <property name="hibernate.hbm2ddl.auto" value="validate"/>
                   <property name="hibernate.show_sql" value="true"/>
                   <property name="hibernate.format_sql" value="true"/>
                   <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
                </properties>
             </persistence-unit>



          When i deploy i get the exception:



          
          ""WARNING: Found unrecognized persistence provider org.hibernate.ejb.HibernatePersistence in place of OpenJPA provider. This provider's properties will not be used.""
          
          


          if i access the url i get a browser error.


          Funny thing is if i comment out


          <transaction:ejb-transaction />

          I get the same warning but i can access my url fine.



          "It states in seam documentation that By default Seam uses a JTA transaction component that integrates with Container Managed and programmatic EJB transactions. If you are working in a Java EE 5 environment, you should install the EJB synchronization component in components.xml:
          
          
          <transaction:ejb-transaction />"



          So my question is can anyone from Seam explain to me how to setup seam to deploy on weblogic correctly and use JTA as container managed transaction manager?












          • 2. Re: Unrecognized persistence provider
            Peter Varga Newbie

            I have just solved the problem, so want to share the solution. In Weblogic 10.3 Persistence class stores PersistenceProvider instances in a protected static final Set. It gets filled up at startup time with default providers accessible from CLASSPATH (openjpa and kodo in my case). After startup no PersistenceProvider is added to the Set any more, while filling up is implemented by lazy init. As Set is no longer empty, searching forPersistenceProvider instances is skipped.


            In order to fix the problem, you need to add hibernate-entitymanager.jar to the CLASSPATH of the server, so HibernatePersistence can be found at startup.