Make BatooJPA OSGi friendly #175

lburgazzoli opened this Issue Mar 12, 2013 · 2 comments

2 participants


It would be nice to be able to use BatooJPA in OSGi environments like Karaf

Batoo Software member

Batoo JPA is designed and coded OSGi in mind so it should be OSGi compatible. But there may exist bugs as it is in incubation . Please, can you send more specific details on the issue. Thanks.


I've tried to install BatooJPA in Apache Karaf and as you can see, the MANIFEST is not OSGi compliant:

karaf@root> install mvn:org.batoo.jpa/batoo-jpa/
[ 199] [Active     ] [            ] [   80] mvn:org.batoo.jpa/batoo-jpa/
karaf@root> headers 199

Bundle 199

Manifest-Version = 1.0
Archiver-Version = Plexus Archiver
Built-By = hceylan
Build-Jdk = 1.7.0_09
Created-By = Apache Maven

In addition it does not export any PersistenceProvider service to be Enterprise OSGi compliant, here a simple example of an Activator for EclipseLink:

public class Activator  implements BundleActivator {

    private static BundleContext context = null;
    private static ServiceRegistration serviceReg = null;

    public void start(BundleContext context) throws Exception {
        this.context = context;

        Hashtable<String,String> props = new Hashtable<String, String>();

        serviceReg = context.registerService(
            new org.eclipse.persistence.jpa.PersistenceProvider(),

    public void stop(BundleContext context) throws Exception {
        if (this.serviceReg != null) {
            this.serviceReg = null;

        this.context = null;
@lburgazzoli lburgazzoli closed this Oct 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment