Community   SpringSource   Projects    Downloads    Documentation    Forums    Training   Exchange   Blogs

Go Back   Spring Community Forums > SpringSource dm Server > dm Server Application Development and Deployment

Reply
 
Thread Tools Display Modes
  #1  
Old Oct 9th, 2008, 09:41 AM
eric_gulatee eric_gulatee is offline
Junior Member
 
Join Date: Oct 2008
Posts: 12
Default Spring DM Server & EclipseLink

All,

I'm having trouble with getting eclipselink and spring server dm working.

Caused by: java.lang.NoClassDefFoundError: org/eclipse/persistence/jpa/PersistenceProvider
at org.springframework.orm.jpa.vendor.EclipseLinkJpaV endorAdapter.<init>(EclipseLinkJpaVendorAdapter.ja va:51)



1- I deployed the osgi eclipselink 1.1 version in
springsource-dm-server-1.0.0.RELEASE\repository\bundles\usr

10/08/2008 11:16 AM 58,159 org.eclipse.persistence.antlr-1.1-M2.jar
10/08/2008 11:16 AM 214,737 org.eclipse.persistence.asm-1.1-M2.jar
10/08/2008 11:16 AM 3,413,391 org.eclipse.persistence.core-1.1-M2.jar
10/08/2008 11:16 AM 443,100 org.eclipse.persistence.jpa-1.1-M2.jar

2- The jpa persistence jpa has the following export: (Which includes the org.eclipse.persistence.jpa)
Export-Package: org.eclipse.persistence.internal.jpa,org.eclipse.p ersi
stence.internal.jpa.deployment,org.eclipse.persist ence.internal.jpa.d
eployment.osgi,org.eclipse.persistence.internal.jp a.deployment.xml.pa
rser,org.eclipse.persistence.internal.jpa.jdbc,org .eclipse.persistenc
e.internal.jpa.metadata,org.eclipse.persistence.in ternal.jpa.metadata
.accessors,org.eclipse.persistence.internal.jpa.me tadata.accessors.cl
asses,org.eclipse.persistence.internal.jpa.metadat a.accessors.mapping
s,org.eclipse.persistence.internal.jpa.metadata.ac cessors.objects,org
.eclipse.persistence.internal.jpa.metadata.cache,o rg.eclipse.persiste
nce.internal.jpa.metadata.changetracking,org.eclip se.persistence.inte
rnal.jpa.metadata.columns,org.eclipse.persistence. internal.jpa.metada
ta.converters,org.eclipse.persistence.internal.jpa .metadata.copypolic
y,org.eclipse.persistence.internal.jpa.metadata.in heritance,org.eclip
se.persistence.internal.jpa.metadata.listeners,org .eclipse.persistenc
e.internal.jpa.metadata.locking,org.eclipse.persis tence.internal.jpa.
metadata.queries,org.eclipse.persistence.internal. jpa.metadata.sequen
cing,org.eclipse.persistence.internal.jpa.metadata .tables,org.eclipse
.persistence.internal.jpa.metadata.transformers,or g.eclipse.persisten
ce.internal.jpa.metadata.xml,org.eclipse.persisten ce.internal.jpa.tra
nsaction,org.eclipse.persistence.jpa,org.eclipse.p ersistence.jpa.osgi
,org.eclipse.persistence.tools.weaving.jpa

3- My own bundle creates the EclipseLinkVendorAdapter bean and import-package org.eclipse.persistence.jpa

My questions are:
What & Why is it not seeing the org.eclipse.persistence.jpa classes? [I am guessing the spring bundles aren't seeing the eclipselink osgi bundles] So I tried moving the eclipselink bundles to
springsource-dm-server-1.0.0.RELEASE\repository\bundles\ext
and the problem persists...

Any ideas? Is this because spring framework doesn't import the eclipselink bundle? Any ways around this? I will dig into the samples one of which seems to do exactly what I'm doing. I don't quite understand.
Reply With Quote
  #2  
Old Oct 9th, 2008, 09:48 AM
eric_gulatee eric_gulatee is offline
Junior Member
 
Join Date: Oct 2008
Posts: 12
Default

Additionally,

When I telnet to the equinox/felix osgi container.

The eclipsejpa is active and is exporting:

org.eclipse.persistence.jpa; version="0.0.0"[exported]
org.eclipse.persistence.jpa.osgi; version="0.0.0"[exported]

I imagine springframework-orm not having the dependency on eclipselink is the problem. Is this correct? Any way around this?

Basically in my own bundle I do have org.eclipse.persitence.jpa imported,
but when I instantiate the adaptor (EclipseLinkJpaVendorAdapter), it's now in the springframework bundle which doesn't have the import. Is there any way around this? Do I need to bundle spring within my par?

org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jpaAdapter' defined in URL [bundleentry://73/META-INF/spring/a
pplicationContext-db-eclipselink.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could n
ot instantiate bean class [org.springframework.orm.jpa.vendor.EclipseLinkJpaV endorAdapter]: Constructor threw exception; nested exception is java.lang
.NoClassDefFoundError: org/eclipse/persistence/jpa/PersistenceProvider
Reply With Quote
  #3  
Old Oct 9th, 2008, 10:41 AM
Sam Brannen Sam Brannen is offline
Senior Member
 
Join Date: Jan 2006
Location: Zürich, Switzerland
Posts: 388
Default

Hi Eric,

First: did you restart the dm Server after installing the EclipseLink bundles in the bundle repository?

Second: have you taken a look at the Pet Clinic sample application which uses EclipseLink within a PAR?

Regards,

Sam
Reply With Quote
  #4  
Old Oct 9th, 2008, 10:45 AM
eric_gulatee eric_gulatee is offline
Junior Member
 
Join Date: Oct 2008
Posts: 12
Default

Quote:
Originally Posted by Sam Brannen View Post
Hi Eric,

First: did you restart the dm Server after installing the EclipseLink bundles in the bundle repository?
Yup.

Quote:
Originally Posted by Sam Brannen View Post
Second: have you taken a look at the <url removed> which uses EclipseLink within a PAR?

Regards,

Sam
Yeah, that's what I am looking at currently.

Thanks.
Reply With Quote
  #5  
Old Oct 10th, 2008, 04:08 AM
robh robh is offline
Senior Member
Spring Modules TeamSpring Team
 
Join Date: Aug 2004
Location: Southampton, UK
Posts: 827
Default

Eric,

I notice that you are not using EclipseLink bundles from our Enterprise Bundle Repository, rather you are using the ones supplied by the EclipseLink project. The issue here is quite a subtle one.

The EclipseLink-supplied bundles have no explicit version on the exports and therefore have version 0 by default. In EBR, the exported packages have version 1.0/1.1 as appropriate.

The NCDFE is actually coming from the Spring ORM bundle which has an _optional_ dependency on EclipseLink in the range [1.0.0, 2.0.0). Since this is optional, OSGi will silently ignore it if it cannot be satisfied.

My recommendation is to use the EclipseLink bundles from EBR (http://www.springsource.com/reposito...se.persistence).

HTH

Rob
__________________
Rob Harrop
Lead Engineer, dm Server
SpringSource
http://www.springsource.com

Co-Author - Pro Spring
Reply With Quote
  #6  
Old Oct 10th, 2008, 11:59 AM
eric_gulatee eric_gulatee is offline
Junior Member
 
Join Date: Oct 2008
Posts: 12
Default

Rob,

Thank you for the indepth explanation.

First off, the reason I am using eclipselink 1.1 was the JPA 2.0 preview feature. [I made a bundle request, but I guess once it's final in Dec it'll appear in SEBR]

What you are pointing out makes sense. [Optional Dependency, failing silently, eclipselink bundles not having correct osgi meta info]
I was trying to expose an entitymanager and was running into the classnotfound exception issue.

I guess my options at this point are:

1- Wait till eclipse 1.1 becomes available [I opened a JIRA ticket & Dec should be eclipselink 1.1 release]
2- Correct the eclipselink-1.1 bundle to add correct osgi headers
3- Try to not expose the entitymanagerfactory via osgi. [Not sure this is feasible in how I have architected the application, I need to check]

Last edited by eric_gulatee; Oct 10th, 2008 at 05:02 PM.
Reply With Quote
Reply

Tags
eclipselink, osgi

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:59 AM.


Contegix provides first-class managed hosting and partial sponsorship of these forums.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.