Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Felix Karaf / No Persistence provider exception

How do you get a persistence provider? How are the javax.persistence bundle and the EclipseLink bundle made available to your test application?

Jean-Philippe Clement wrote:
One of the reasons to migrate to EclipseLink is to use, as far as possible, the 'true OSGi' manner.

For the moment, the only 'hack' is the inclusion of the DB driver (and the dynamic import which is only for testing purpose):
Bundle-ClassPath: .,lib/ojdbc14.jar

Maybe more hacking has to be done (?)


Quoting Tom Ware <tom.ware@xxxxxxxxxx>:

Are you trying to use JPA in a truely OSGi manner? (or are you hacking
it so all the resources necessary are available on a single classloader)

The standard for using JPA on OSGi is very new.  Our latest release
allows you to use it in conjunction with the Eclipse Gemini project
which is the reference implementation for the Java EE standard for
OSGi. (http://www.eclipse.org/gemini/)

We also have an EclipseLink-specific implementation that was used as
our OSGi implementation prior to the specification.  There is an
example here:

http://fisheye2.atlassian.com/browse/eclipselink/trunk/examples/org.eclipse.persistence.example.jpa.rcp.comics/ReadMe.txt?r=HEAD

I am not certain how the Hibernate implementation works, but I suspect
that JPA implementers will gradually move the the standard - which
should make applications more portable.

-Tom


Jean-Philippe Clement wrote:
Karaf is a standalone OSGi 4.2 implementation. I use Karaf v1.6.0 (http://felix.apache.org/site/apache-felix-karaf.html)

Quoting Tim Hollosy <hollosyt@xxxxxxxxx>:

What environment? Is it an OSGI thick client? Web App? What framework?

./tch



On Wed, Aug 4, 2010 at 9:20 AM, Jean-Philippe Clement
<jeanphilippe.clement@xxxxxxxxxx> wrote:
Hello, I'm currently using Hibernate and I would like to migrate to
EclipseLink.

I made a quick test which leads to the exception PersistenceException: No
Persistence provider for EntityManager named JPATest.

Here are installed bundles:
[  37] [Active     ] [            ] [   60] EclipseLink ANTLR
(2.1.0.v20100614-r7608)
[  38] [Active     ] [            ] [   60] EclipseLink ASM
(2.1.0.v20100614-r7608)
[  39] [Active     ] [            ] [   60] EclipseLink Core
(2.1.0.v20100614-r7608)
[  40] [Resolved   ] [            ] [   60] JPA Test (1.0.0)
[ 41] [Installed ] [ ] [ 60] EclipseLink OSGi Deployment
Fragment (deprectated, non Gemini) (2.1.0.v20100614-r7608)
[  42] [Active     ] [            ] [   60] JTA (1.1.0.v201002051055)
[  43] [Active     ] [            ] [   56] EclipseLink JPA
(2.1.0.v20100614-r7608)
[  44] [Active     ] [            ] [   54] Java Persistence API 2.0
(2.0.1.v201006031150)

Test bundle stucture:
+ com
+ ...
+ lib
ojdbc14.jar
+ META-INF
MANIFEST.MF
persistence.xml
+ OSGI-INF
+ blueprint
jpa-test.xml

MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.xxx.test
Bundle-Version: 1.0.0
Bundle-Name: JPA Test
Bundle-Description: Testing
Bundle-Vendor: XXX
JPA-PersistenceUnits: JPATest
DynamicImport-Package: *
Import-Package: org.osgi.framework
Bundle-ClassPath: .,lib/ojdbc14.jar

persistence.xml:
<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_2_0.xsd";
      version="2.0">
      <persistence-unit name="JPATest">

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <class>com.xxx.JPAData</class>
              <class>com.xxx.JPAOwner</class>
              <properties>
                      <property name="javax.persistence.jdbc.driver"
value="oracle.jdbc.OracleDriver" />
                      <property name="javax.persistence.jdbc.url"
value="jdbc:oracle:thin:@192.1.1.1:1521:stuff" />
                      <property name="javax.persistence.jdbc.user"
value="user" />
                      <property name="javax.persistence.jdbc.password"
value="password" />
                      <property name="eclipselink.logging.level"
value="FINEST" />
                      <property name="eclipselink.target-database"
value="Oracle10g" />
              </properties>
      </persistence-unit>
</persistence>

I have no clue what the problem is!


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users




_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top