2

We are in the OSGi world.

So it seems that injectable EntityListener doesn't work in OSGi, even when EclipseLink supports them.

Is it currently possible to define EntityListener in blueprint.xml and use them for injection? This would allow to inject OSGi Services into an Entity Listener. (Currently we need an explicit lookup using FrameworkUtil to do the lookup.)

Has anybody done so successfully and can share some hints, especially in regard to the used bundle (versions)?

xwoker
  • 3,105
  • 1
  • 30
  • 42

1 Answers1

0

Have you tried using the following maven dependency with org.eclipse.persistence.jpa.PersistenceProvider in the provider-Element of the persistence.xml? In the case of a JEE application server, the classloader would prefer libraries packaged with the deployed application by the ones bundled with the server itself.

    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.5.1</version>
        <scope>provided</scope>
    </dependency>
Patrick Leitermann
  • 2,144
  • 2
  • 13
  • 13