3

I keep getting The server cannot create an EntityManagerFactory factory for the default persistent unit from the org.hibernate.ejb.HibernatePersistence provider when I try to run the web application(.war) on the WebSphere 7 + Oracle .This worked well so far under the tomcat + MySql. my persistance.xml's config

<persistence-unit name="default">
        <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
        <non-jta-data-source>src/test</non-jta-data-source>     
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.Oracle10gDialect"/>
            <property name="hibernate.hbm2ddl.auto" value="validate"/>
            <property name="hibernate.connection.release_mode" value="after_transaction"/>            
    </persistence-unit>

There were several solutions for this, after googling. But there was no luck even after trying them for about 2 days. To fix this issue do we need to install any fix-pack in WebSphere? Please find the stack-trace files in below link.

https://www.ibm.com/developerworks/community/forums/html/topic?id=e54136aa-fbe0-4576-a41c-4b438475f0a5

Xstian
  • 8,184
  • 10
  • 42
  • 72
user3496599
  • 1,207
  • 2
  • 12
  • 28

1 Answers1

1

In WebSphere v7 to use container managed JPA you need to install feature pack for JPA and it will only support JPA 2.0.

Based on your logs it looks like you are using Hibernate 4.3 which is JPA 2.1. You cant use that with classic WebSphere Application Server, see Deploying application using Hibernate JPA 2.1 to IBM WebSphere for more details.

So you either would need to downgrade to Hibernate 4.2, use application managed Entity manager, or migrate to WebSphere Liberty Profile server 8.5.5.6 or later which fully supports JPA 2.1.

If your application works on Tomcat, I'd suggest trying WebSphere Liberty, which is also lightweight, developer friendly server, available to download for free - https://developer.ibm.com/wasdev/

Community
  • 1
  • 1
Gas
  • 17,601
  • 4
  • 46
  • 93