users@glassfish.java.net

Using EclipseLink as persistence provider in osgi bundle

From: <glassfish_at_javadesktop.org>
Date: Sun, 26 Apr 2009 06:01:37 PDT

Hi,

i currently try to extend glassfish v3. For that i want to use EclipseLink as my PersistenceProvider.

What i have already done:

i use declarative service to inject the PersistenceProvider into my service.
To be able to load the persistence.xml File and referenced Entity classes i provide the bundleclassloader via the "eclipselink.classloader" property.

I also added the eclipselink core package as dependency and import some packages from there.
(after i got some classnotfoundexceptions)

Now i need to resolve the jdbc resource via jndi, which doesn't work:

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

I guess providing the bundleclassloader via property is no nice solution. The list of dependencies will grow more and more (i guess the jnd problem could also solved by adding some further dependencies).

Is there already some kind of documentation which explains how to use jpa in osgi bundles on glassfish v3?

Thank in advance,

Andreas
[Message sent by forum member 'aluedeke' (aluedeke)]

http://forums.java.net/jive/thread.jspa?messageID=343836