You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "David Blevins (JIRA)" <ji...@apache.org> on 2008/10/09 22:44:44 UTC

[jira] Created: (OPENEJB-921) Improved OSGi integration

Improved OSGi integration
-------------------------

                 Key: OPENEJB-921
                 URL: https://issues.apache.org/jira/browse/OPENEJB-921
             Project: OpenEJB
          Issue Type: Improvement
          Components: configuration
            Reporter: David Blevins
            Assignee: David Blevins
             Fix For: 3.0.x




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-921) Improved OSGi integration

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639734#action_12639734 ] 

Guillaume Nodet commented on OPENEJB-921:
-----------------------------------------

FYI, all the J2EE specifications jars from Geronimo are OSGi bundles, so instead of hacking the list of packages exported by the system bundle, you can also just deploy these bundles.

> Improved OSGi integration
> -------------------------
>
>                 Key: OPENEJB-921
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-921
>             Project: OpenEJB
>          Issue Type: Improvement
>          Components: configuration
>            Reporter: David Blevins
>            Assignee: David Blevins
>             Fix For: 3.0.x
>
>         Attachments: OpenEjbFactory.java
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-921) Improved OSGi integration

Posted by "Zog The Bogue (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zog The Bogue updated OPENEJB-921:
----------------------------------

    Attachment: OpenEjbFactory.java

> Improved OSGi integration
> -------------------------
>
>                 Key: OPENEJB-921
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-921
>             Project: OpenEJB
>          Issue Type: Improvement
>          Components: configuration
>            Reporter: David Blevins
>            Assignee: David Blevins
>             Fix For: 3.0.x
>
>         Attachments: OpenEjbFactory.java
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-921) Improved OSGi integration

Posted by "Zog The Bogue (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639461#action_12639461 ] 

Zog The Bogue commented on OPENEJB-921:
---------------------------------------

I succeeded loading OpenEJB in Felix 1.2.1 with a reasonable configuration. It's far from perfect, as it just allows you to run
OpenEJB from inside OSGi and doesn't provide much modularity (like having your EJBs jars in separate bundles), but that's
a start - and fit my needs for now.
Here are the steps I followed:
1- Bundled the openejb distribution jars except javaee-api-5.0-1.jar in a single bundle.
The bundle has the following structure:
 META-INF/MANIFEST.MF
 log4j.properties
 lib/XmlSchema-1.3.2.jar
lib/activeio-core-3.0.0-incubator.jar
lib/.... etc
2- Used the following directives in MANIFEST.MF:
Bundle-Classpath: .,lib/XmlSchema-1.3.2.jar,lib/activeio-core-3.0.0-incubator.jar,
 lib/activemq-core-4.1.1.jar,lib/activemq-ra-4.1.1.jar,lib/asm-2.2.3.jar,
 lib/asm-commons-2.2.3.jar,lib/asm-tree-2.2.3.jar,lib/backport-util-concurrent-2.1.jar,
 lib/commons-cli-1.1.jar,lib/commons-collections-3.2.jar,lib/commons-dbcp-all-1.3.jar,
 lib/commons-lang-2.1.jar,lib/commons-logging-1.1.jar,lib/cxf-bundle-2.0.4-incubator.jar,
 lib/geronimo-connector-2.1.jar,lib/geronimo-javamail_1.4_mail-1.2.jar,
 lib/geronimo-transaction-2.1.jar,lib/howl-1.0.1-1.jar,lib/hsqldb-1.8.0.7.jar,
 lib/javaee-api-5.0-1.jar,lib/jaxb-impl-2.0.5.jar,lib/log4j-1.2.12.jar,
 lib/neethi-2.0.2.jar,lib/openejb-client-3.0.jar,lib/openejb-core-3.0.jar,
 lib/openejb-cxf-3.0.jar,lib/openejb-ejbd-3.0.jar,lib/openejb-hsql-3.0.jar,
 lib/openejb-http-3.0.jar,lib/openejb-javaagent-3.0.jar,lib/openejb-jee-3.0.jar,
 lib/openejb-loader-3.0.jar,lib/openejb-server-3.0.jar,lib/openejb-telnet-3.0.jar,
 lib/openejb-webservices-3.0.jar,lib/openjpa-1.0.1.jar,lib/saaj-impl-1.3.jar,
 lib/serp-1.13.1.jar,lib/slf4j-api-1.3.1.jar,lib/slf4j-jdk14-1.3.1.jar,
 lib/swizzle-stream-1.0.1.jar,lib/wsdl4j-1.6.1.jar,lib/wstx-asl-3.2.1.jar,
 lib/xbean-finder-3.4-r636442.jar,lib/xbean-naming-3.3.jar,lib/xbean-reflect-3.4-r636442.jar,
 lib/xml-resolver-1.2.jar
Import-Package: javax.naming,javax.xml.parsers,javax.xml.transform,javax.xml.datatype,
 javax.xml.namespace,javax.management,javax.sql,javax.xml.ws,javax.annotation,
 javax.annotation.security,javax.interceptor,javax.jws,javax.persistence,
 javax.persistence.spi,sun.misc,javax.naming.spi,
 org.xml.sax,org.xml.sax.helpers,org.omg.CORBA,
 javax.ejb,javax.ejb.spi,javax.transaction,javax.resource,javax.resource.spi,javax.resource.spi.work,
 javax.xml.bind,javax.activation,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,
 javax.xml.bind.helpers,javax.xml.stream,javax.xml.transform.sax,javax.transaction.xa,
 javax.security.jacc,javax.security.auth,javax.security.auth.login,javax.security.auth.callback,
 javax.jms,javax.resource.spi.endpoint,javax.management.j2ee.statistics,javax.net,
 org.osgi.framework;version="1.4.0"

Of course, you need to plug there a bit more as you see fit  - like the Bundle-Name and others, and
your activator class.

3- Exported the j2ee classes from the bootstrap classloader in the Felix configuration file, 
config.properties:
 org.osgi.framework.system.packages=org.osgi.framework; version=1.4.0, \
 org.osgi.service.packageadmin; version=1.2.0, \
 org.osgi.service.startlevel; version=1.1.0, \
 org.osgi.service.url; version=1.0.0, \
 org.osgi.util.tracker; version=1.3.3, \
 javax.accessibility; \
 javax.activity; \
 javax.crypto; \
 javax.crypto.interfaces; \
 javax.crypto.spec; \
 javax.imageio; \
 javax.imageio.event; \
 javax.imageio.metadata; \
 javax.imageio.plugins.bmp; \
 javax.imageio.plugins.jpeg; \
 javax.imageio.spi; \
 javax.imageio.stream; \
 javax.management; \
 javax.management.loading; \
 javax.management.modelmbean; \
 javax.management.monitor; \
 javax.management.openmbean; \
 javax.management.relation; \
 javax.management.remote; \
 javax.management.remote.rmi; \
 javax.management.timer; \
 javax.naming; \
 javax.naming.directory; \
 javax.naming.event; \
 javax.naming.ldap; \
 javax.naming.spi; \
 javax.net; \
 javax.net.ssl; \
 javax.print; \
 javax.print.attribute; \
 javax.print.attribute.standard; \
 javax.print.event; \
 javax.rmi; \
 javax.rmi.CORBA; \
 javax.rmi.ssl; \
 javax.security.auth; \
 javax.security.auth.callback; \
 javax.security.auth.kerberos; \
 javax.security.auth.login; \
 javax.security.auth.spi; \
 javax.security.auth.x500; \
 javax.security.sasl; \
 javax.sound.midi; \
 javax.sound.midi.spi; \
 javax.sound.sampled; \
 javax.sound.sampled.spi; \
 javax.sql; \
 javax.sql.rowset; \
 javax.sql.rowset.serial; \
 javax.sql.rowset.spi; \
 javax.swing; \
 javax.swing.border; \
 javax.swing.colorchooser; \
 javax.swing.event; \
 javax.swing.filechooser; \
 javax.swing.plaf; \
 javax.swing.plaf.basic; \
 javax.swing.plaf.metal; \
 javax.swing.plaf.multi; \
 javax.swing.plaf.synth; \
 javax.swing.table; \
 javax.swing.text; \
 javax.swing.text.html; \
 javax.swing.text.html.parser; \
 javax.swing.text.rtf; \
 javax.swing.tree; \
 javax.swing.undo; \
 javax.transaction; \
 javax.transaction.xa; \
 javax.xml; \
 javax.xml.datatype; \
 javax.xml.namespace; \
 javax.xml.parsers; \
 javax.xml.transform; \
 javax.xml.transform.dom; \
 javax.xml.transform.sax; \
 javax.xml.transform.stream; \
 javax.xml.validation; \
 javax.xml.xpath; \
 javax.xml.ws; \
 javax.xml.ws.spi; \
 javax.xml.ws.soap; \
 javax.xml.ws.handler; \
 org.ietf.jgss; \
 org.omg.CORBA; \
 org.omg.CORBA_2_3; \
 org.omg.CORBA_2_3.portable; \
 org.omg.CORBA.DynAnyPackage; \
 org.omg.CORBA.ORBPackage; \
 org.omg.CORBA.portable; \
 org.omg.CORBA.TypeCodePackage; \
 org.omg.CosNaming; \
 org.omg.CosNaming.NamingContextExtPackage; \
 org.omg.CosNaming.NamingContextPackage; \
 org.omg.Dynamic; \
 org.omg.DynamicAny; \
 org.omg.DynamicAny.DynAnyFactoryPackage; \
 org.omg.DynamicAny.DynAnyPackage; \
 org.omg.IOP; \
 org.omg.IOP.CodecFactoryPackage; \
 org.omg.IOP.CodecPackage; \
 org.omg.Messaging; \
 org.omg.PortableInterceptor; \
 org.omg.PortableInterceptor.ORBInitInfoPackage; \
 org.omg.PortableServer; \
 org.omg.PortableServer.CurrentPackage; \
 org.omg.PortableServer.POAManagerPackage; \
 org.omg.PortableServer.POAPackage; \
 org.omg.PortableServer.portable; \
 org.omg.PortableServer.ServantLocatorPackage; \
 org.omg.SendingContext; \
 org.omg.stub.java.rmi; \
 org.omg.stub.javax.management.remote.rmi; \
 org.w3c.dom; \
 org.w3c.dom.bootstrap; \
 org.w3c.dom.css; \
 org.w3c.dom.events; \
 org.w3c.dom.html; \
 org.w3c.dom.ls; \
 org.w3c.dom.ranges; \
 org.w3c.dom.stylesheets; \
 org.w3c.dom.traversal; \
 org.w3c.dom.views; \
 org.xml.sax; \
 org.xml.sax.ext; \
 org.xml.sax.helpers; \
 sun.misc; \
 version="1.5.0", \
 javax.activation; \
 javax.annotation; \
 javax.annotation.security; \
 javax.ejb; \
 javax.ejb.spi; \
 javax.jms; \
 javax.jws; \
 javax.interceptor; \
 javax.management.j2ee; \
 javax.management.j2ee.statistics; \
 javax.persistence; \
 javax.persistence.spi; \
 javax.mail; \
 javax.resource; \
 javax.resource.spi; \
 javax.resource.spi.endpoint; \
 javax.resource.spi.work; \
 javax.security.jacc; \
 javax.security.auth; \
 javax.security.auth.login; \
 javax.security.auth.callback; \
 javax.wsdl; \
 javax.wsdl.extensions.http; \
 javax.wsdl.extensions.soap; \
 javax.wsdl.factory; \
 javax.wsdl.xml; \
 javax.xml.bind; \
 javax.xml.bind.annotation; \
 javax.xml.bind.annotation.adapters; \
 javax.xml.bind.helpers; \
 javax.xml.stream; \
 version="5.0.1"

4- Created an OpenEJB factory class that loads and initialize openejb from configuration (see attached file)

5- Created a BundleActivator that does simply
    public void start(BundleContext aContext) throws Exception
    {
        ClassLoader cl = this.getClass().getClassLoader();
        Thread.currentThread().setContextClassLoader(cl);
        
        mOpenEjb = new OpenEjbFactory();
        mOpenEjb.init();
    }
        
   public void stop(BundleContext aContext) throws Exception
    {
        ClassLoader cl = this.getClass().getClassLoader();
        Thread.currentThread().setContextClassLoader(cl);
        mOpenEjb.destroy();
    }

6- Started Felix with javaee-api-5.0-1.jar on the system classpath (cmd line)

7- Loaded the openejb bundle

CAVEATS:
- The Jndi initialcontext factory provided by OpenEJB just gives access to java:openejb/ejb - I had to provide
direct access to the full openejb context via my OpenEjbFactory.getJNDIContext() API.



> Improved OSGi integration
> -------------------------
>
>                 Key: OPENEJB-921
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-921
>             Project: OpenEJB
>          Issue Type: Improvement
>          Components: configuration
>            Reporter: David Blevins
>            Assignee: David Blevins
>             Fix For: 3.0.x
>
>         Attachments: OpenEjbFactory.java
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.