Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Re: [eclipselink-users] Re: EclipseLink with Apache Felix

'looks like we lost the Dev list from this thread somehow.  Readding.

Andreas Kollegger wrote:
Hi Tom,

Looking more closely at the derby bundle, I realized that default distribution no longer includes the client. So, I switched from mvn:org.apache.derby:derby:10.4.2.0 to mvn:org.apache.derby:derbyclient:10.4.2.0 but the oddly the client is not packaged as a bundle (though the server is). The solution you point to in the RCP example is not portable, as it relies on an equinox extension to load an external jar. Instead, a wrapper bundle can be created to embed the derbyclient.jar and export the proper packages using bnd. That's what I've done. The RCP Comics example deployed
to Felix now works using EclipseLink 1.2.0.

For 2.0, I downloaded javax.persistence_2.0_preview.jar from the nightly build and installed locally, since the maven repository mirrors I tried are all about 3 days behind. That also now works. I'll manually installed the recently
released 2.0.0-M9 and verify that works as well.

Thanks again so much for all your help in getting this sorted out.

If anyone is interested in a working version of the RCP Comics Example running under Felix, Equinox, or Knopflerfish
let me know. I'd be happy to post it somewhere for reference.

Cheers,
Andreas


On Oct 9, 2009, at 1:12 PM, Tom Ware wrote:

Hi Andreas,

For the database issue, have you looked at the ReadMe file in our RCP example. It explains how to get a Derby JDBC bundle setup in Eclipse. It should be fairly easily translatable to any OSGi config.

http://fisheye2.atlassian.com/browse/~raw,r=2098/eclipselink/trunk/examples/org.eclipse.persistence.example.jpa.rcp.comics/ReadMe.txt

I just took a look at the javax.persistence 2.0.0 Snapshot from this morning. The class is in there. Try getting the very latest and see if you still have an issue. The class was added in the last couple of days.

-Tom

Andreas Kollegger wrote:
Hi Tom,
First, thanks for taking the time to help me out with this stuff.
For 1.2, it is fatal because the exception percolates all the way up to
the comics example's CreateAndInitDatabase where it does this:
Map<String, Object> properties = new HashMap<String, Object>(); properties.put("eclipselink.ddl-generation", "drop-and-create-tables"); properties.put("eclipselink.ddl-generation.output-mode", "database"); properties.put("eclipselink.classloader", this.getClass().getClassLoader());
           emf = new PersistenceProvider()
                   .createEntityManagerFactory("comics", properties);
           em = emf.createEntityManager();
           em.getTransaction().begin();
The emf.createEntityManager() is what fails.
For 2.0, I was using a dependency on:
   <dependency>
     <groupId>org.eclipse.persistence</groupId>
     <artifactId>javax.persistence</artifactId>
     <version>2.0.0-SNAPSHOT</version>
   </dependency>
I don't see a version 2.0.preview in the online maven repositories, but maybe I'm not using the correct artifact. Poking around and trying different downloads, I was able to find a javax.persistence_2.0_preview.jar in the nightly builds for the plugins, which does have the
missing class.
Is the class very new? Perhaps the mirrors just don't have it yet.
-Andreas
On Oct 9, 2009, at 11:45 AM, Tom Ware wrote:
Hi Andreas,

Does the exception you see on 1.2 cause you any issues, or is it just a logged message? When we get the JDBC driver, we try the traditional DriverManager approach to get it before trying a more OSGi friendly approach. Until a recent change on our 2.0 stream, we logged that exception at a level that was too high.

As for 2.0, have you updated your javax.persistence_2.0.preview bundle. That class appears to be in the bundle I see in last-night's build. It is certainly possible earlier builds have had some missing classes since there has been alot of churn in the JPA 2.0 API recently. Fortunately, starting with our Milestone build today, the classes are theoretically final.

-Tom

Andreas Kollegger wrote:
Checking... you are correct, my local repository had older snapshots. The latest 2.0.0 and 1.2.0 snapshots correctly import javax.xml.namespace -- I'll use either of those instead of 1.1.3.
Now I have either a driver loading issue with 1.2.0-SNAPSHOT...
Exception Description: Configuration error. Class [org.apache.derby.jdbc.ClientDriver] not found. at org.eclipse.persistence.exceptions.DatabaseException.configurationErrorClassNotFound(DatabaseException.java:82) at org.eclipse.persistence.sessions.DefaultConnector.loadDriverClass(DefaultConnector.java:265) Which looks like it would require either a dynamic-import or way to provide a classloader (or the driver itself)
to the EntityManagerFactory.
And, if I switch to 2.0.0 I encounter a missing class...
ERROR: Error starting file:bundles/org.eclipse.persistence.example.jpa.comics.setup_1.0.0.SNAPSHOT.jar (org.osgi.framework.BundleException: Activator start error in bundle org.eclipse.persistence.example.jpa.comics.setup [8].)
java.lang.NoClassDefFoundError: javax/persistence/MapsId
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ObjectAccessor.<init>(ObjectAccessor.java:119) The javax.persistence_1.99.6.v200910060108.jar (aka javax.persistence-2.0.0-20091006.061635-181.jar) does not have
that MapsId.
-Andreas
On Oct 9, 2009, at 11:02 AM, Tom Ware wrote:
BND was recently integrated into the build process in 1.2 and 2.0. (This enhancement is currently not planned for 1.1.3) How recent is the 2.0 version you are using? Which bundle do you see the issue on?

-Tom

Andreas Kollegger wrote:
So, is bnd still not being used in the build process? I just tried the latest snapshots of 2.x and the released 1.1.3 build. The manifest is still wrong, missing a reference to java.xml.namespace which causes the ClassConstants class
to fail loading under Felix and even Equinox.
Should I raise a jira issue for it?
-Andreas
On Sep 14, 2009, at 10:53 PM, Andreas Kollegger wrote:
Hi all,

Back in July there was some discussion about a problem running EclipseLink with Apache Felix, ultimately sticking at a ClassNotFoundException:

java.lang.NoClassDefFoundError: javax/xml/namespace/QName
at org.eclipse.persistence.internal.helper.ClassConstants.<clinit>(ClassConstants.java:127) at org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap.getDefaultIdentityMapClass(AbstractIdentityMap.java:297) at org.eclipse.persistence.sessions.Project.<init>(Project.java:84)

There was mention of starting to use bnd in the build process (which was very encouraging) and looking for workarounds in the meantime. It's not that the system isn't exposing the javax.xml.namespace, but that the bundles aren't importing it.

As a test, I repackaged the comics example as a maven multi-module project which uses pax-runner to launch the bundle into plain-old-felix. Any of the 1.1X and 2.0x bundles I've tried from the maven repositories still have the problem. The project is attached for reference. You can change the eclipselink version being deployed by just editing a property in the top-level pom.

Best,
Andreas

<comics-osgi.zip>
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top