I have liferay 6.1 bundled with tomcat 7 (already populated with some data from users, that's why I cannot switch to liferay bundled with glassfish) and now I'm trying to develope new portlet with persistence and the whole EJB stuff. I found that there should be some way to integrate tomcat 7 with openEJB and that's my question - how can I do that?
Now I have liferay portlet project with maven dependency

<dependency>
   <groupId>org.apache.openejb</groupId>
   <artifactId>javaee-api</artifactId>
   <version>6.0-5</version>
</dependency>

and persistence.xml file

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"; version="1.0">
<persistence-unit name="kepler_v1PU">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <properties>
<property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost:3306/kepler_v1"/> <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
      <property name="openjpa.ConnectionUserName" value="xyz"/>
      <property name="openjpa.ConnectionPassword" value="xyz"/>
      <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
    </properties>
  </persistence-unit>
</persistence>

And I'm still getting the error
javax.persistence.PersistenceException: No Persistence provider for EntityManager named kepler_v1PU

Do you have any idea how can I resolve this issue?
Maybe it's related with duplicated jars (for example there are liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/lib/ext/persistence.jar and liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/lib/annotations-api.jar with implementations of the class javax.persistence.Persistence).

Regards,
Piotrek Spyra.

Reply via email to