tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zog <>
Subject Re: OpenEJB in an OSGi container
Date Fri, 10 Oct 2008 19:04:55 GMT

Thought I should give a first update here:
I took the approach to package the whole OpenEJB (except the javaee jar)
inside a single bundle,
trying to run from inside OSGi but still configuring from
openejb.home/conf/openejb.xml and
loading my EJBs from openejb.home/apps.
I did 2 things:
- created an osgi bundle with proper Import-Package and Bundle-Classpath
(classpath contains the whole openejb/lib minus javaee)
- dropped openejb installation in a local './openejb' dir
- used adapted code from Guillaume OpenEjbFactory to load openejb in my
bundle activator:
         properties = new Properties();
         properties.put("openejb.home", "./openejb");
         properties.put("openejb.base", "./openejb");
         properties.put("openejb.deployments.classpath.include", " ");
         properties.put("openejb.deployments.classpath", "true");
        SystemInstance system = SystemInstance.get();

        ApplicationServer appServer = new ServerFederation();
        system.setComponent(ApplicationServer.class, appServer);

        Assembler assembler = new Assembler();
        Properties props = new Properties();

This works almost ok, BUT
- because OpenEJB expect resources to be accessible through jars URLs, the
openejb-core-3.0.jar EJBs do not load. Actually, if I use the default empty
value for
openejb.deployments.classpath.include, I get a NPE in
because the META-INF dirs have classpath URLs that look like
'bundle://5.0:1/META-INF" - looks
like xbean ResourceFinder doesn't work well in OSGi - will look into it.
- JNDI tree doesn't seem to be working well: I can find my beans, but not my
datasources and 
openejb/ subcontext is missing.

I attach the log in case someone want to have a look. openejb.log 

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message