Announcement Announcement Module
No announcement yet.
Spring DM Server & EclipseLink Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring DM Server & EclipseLink


    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

    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
    rser,org.eclipse.persistence.internal.jpa.jdbc,org .eclipse.persistenc
    e.internal.jpa.metadata, ternal.jpa.metadata
    asses,org.eclipse.persistence.internal.jpa.metadat a.accessors.mapping
    s, 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, 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

    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
    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.

  • #2

    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


    • #3
      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?




      • #4
        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?

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


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



        • #5

          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 (




          • #6

            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, 04:02 PM.