You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Simon Burns <si...@uk.ibm.com> on 2005/10/25 13:33:42 UTC

Modularizing Geronimo using OSGi

I worked on the Eclipse Equinox project to bring the OSGi framework up to
the OSGi R4 specification.  As part of that I did some prototyping of
Geronimo on OSGi.  I have recently revisited this work and have got
Geronimo starting successfully on OSGi.  Since there has been some
discussion of Geronimo and OSGi on this mailing list recently I thought it
might be useful to post what I have done.

I started with Geronimo milestone build M4 (the latest build when I
started).  Apart from a couple of minor changes, the Geronimo code is
untouched.  This means that it is still using the GBean framework within
OSGi.  There were no changes to the OSGi framework.

The OSGi bundles (listed below) directly map to the Geronimo jars:

         geronimo-common
         geronimo-core
         geronimo-deploy-config
         geronimo-deployment
         geronimo-j2ee
         geronimo-j2ee-schema
         geronimo-kernel
         geronimo-management
         geronimo-naming
         geronimo-spec-ejb
         geronimo-spec-j2ee-connector
         geronimo-spec-j2ee-deployment
         geronimo-spec-j2ee-jacc
         geronimo-spec-j2ee-management
         geronimo-spec-jta
         geronimo-spec-servlet
         geronimo-system
         geronimo-transaction

To make these projects into bundles I added OSGi meta-data into a manifest
file.  This defines the dependencies of the bundle.  As an example here is
the manifest for geronimo-common:

      Manifest-Version: 1.0
      Bundle-ManifestVersion: 2
      Bundle-Name: geronimo-common
      Bundle-SymbolicName: geronimo_common
      Bundle-Version: 1.0.0
      Bundle-Localization: plugin
      Import-Package:
       javax.management,
       org.apache.geronimo.kernel,
       org.apache.xmlbeans
      Export-Package:
       org.apache.geronimo.common,
       org.apache.geronimo.common.propertyeditor
      Bundle-ClassPath: bin/, .

In addition to this I had the OSGi system bundle from Eclipse
(org.eclipse.osgi) - I just used the latest version from HEAD in the
Eclipse CVS repository (anonymous pserver access to
'dev.eclipse.org:/home/eclipse'), though any version (3.1 or later) should
be ok (binaries of the OSGi framework are available from
http://download.eclipse.org/eclipse/equinox).

Geronimo is dependant on quite a lot of non-Geronimo code (e.g.
commons-logging, mx4j, etc), and so I grouped all of these jars into a
single bundle (called 'other') and set up some appropriate meta-data for
it.  I also had to add in 2 more jars to this project - one with
org.objectweb.asm, and one containing the JSR173 packages.

As I mentioned earlier there were a couple of minor changes to Geronimo (in
geronimo-system).  The first was in
org.apache.geronimo.system.main.Daemon.doStartup().  I was getting a
failure from some of the code in here because "startup-jar" does not
contain a manifest.  I'm not sure how this would normally work.  I just
commented out the lines that used the manifest.  The other change was to
the static initializer in
org.apache.geronimo.system.serverinfo.DirectoryUtils.  It was using a
JarURLConnection, but running in OSGi, it gets returned a
BundleURLConnection, so I modified it to use this instead.  Finally I added
a bundle activator to geronimo-system so that the bundle could be started.
This activator simply calls the main() method in Daemon.

Once all this had been done I could start up Geronimo on OSGi (using either
the Eclipse OSGi console or my own launcher program).  I can make this work
available if people are interested.

Simon.


Re: Modularizing Geronimo using OSGi

Posted by Wade Chandler <hw...@yahoo.com>.
--- "Thomas P. Fuller"
<th...@coherentlogic.com> wrote:

> http://en.wikipedia.org/wiki/OSGi
> 
> --- Jacek Laskowski <jl...@apache.org> wrote:
> 
> > John Sisson wrote:
> > > Hi Simon,
> > > 
> > > For those new to OSGi, such as myself, would you
> > be able to give an 
> > > overview of the benefits that OSGi would bring
> to
> > Geronimo
> > 
> > Thanks John you've asked about it. I was wondering
> > alike when I first 
> > saw Dain's email about OSGi. What is that? It
> seems
> > Geronimo is so 
> > similar to OSGi after having read the work done by
> > Simon. Does anyone 
> > know a good presentation/article that would
> explain
> > the OSGi concepts?
> > 
> > > John
> > 
> > Jacek
> > 
> 
> 

Even better the OSGi provide nice documentation
downloadable along with the APIs at www.osgi.org.

Wade

Re: Modularizing Geronimo using OSGi

Posted by "Thomas P. Fuller" <th...@coherentlogic.com>.
http://en.wikipedia.org/wiki/OSGi

--- Jacek Laskowski <jl...@apache.org> wrote:

> John Sisson wrote:
> > Hi Simon,
> > 
> > For those new to OSGi, such as myself, would you
> be able to give an 
> > overview of the benefits that OSGi would bring to
> Geronimo
> 
> Thanks John you've asked about it. I was wondering
> alike when I first 
> saw Dain's email about OSGi. What is that? It seems
> Geronimo is so 
> similar to OSGi after having read the work done by
> Simon. Does anyone 
> know a good presentation/article that would explain
> the OSGi concepts?
> 
> > John
> 
> Jacek
> 


Re: Modularizing Geronimo using OSGi

Posted by Jacek Laskowski <jl...@apache.org>.
John Sisson wrote:
> Hi Simon,
> 
> For those new to OSGi, such as myself, would you be able to give an 
> overview of the benefits that OSGi would bring to Geronimo

Thanks John you've asked about it. I was wondering alike when I first 
saw Dain's email about OSGi. What is that? It seems Geronimo is so 
similar to OSGi after having read the work done by Simon. Does anyone 
know a good presentation/article that would explain the OSGi concepts?

> John

Jacek

Re: Modularizing Geronimo using OSGi

Posted by John Sisson <js...@apache.org>.
Hi Simon,

For those new to OSGi, such as myself, would you be able to give an 
overview of the benefits that OSGi would bring to Geronimo and some info 
on what parts of the OSGi framework would be used, e.g. what services 
mentioned in http://www.osgi.org/osgi_technology/index.asp?section=2 
would be used?

Would you expect geronimo's performance/footprint to be impacted through 
the use of OSGi?

Thanks,

John

Simon Burns wrote:
> I worked on the Eclipse Equinox project to bring the OSGi framework up to
> the OSGi R4 specification.  As part of that I did some prototyping of
> Geronimo on OSGi.  I have recently revisited this work and have got
> Geronimo starting successfully on OSGi.  Since there has been some
> discussion of Geronimo and OSGi on this mailing list recently I thought it
> might be useful to post what I have done.
> 
> I started with Geronimo milestone build M4 (the latest build when I
> started).  Apart from a couple of minor changes, the Geronimo code is
> untouched.  This means that it is still using the GBean framework within
> OSGi.  There were no changes to the OSGi framework.
> 
> The OSGi bundles (listed below) directly map to the Geronimo jars:
> 
>          geronimo-common
>          geronimo-core
>          geronimo-deploy-config
>          geronimo-deployment
>          geronimo-j2ee
>          geronimo-j2ee-schema
>          geronimo-kernel
>          geronimo-management
>          geronimo-naming
>          geronimo-spec-ejb
>          geronimo-spec-j2ee-connector
>          geronimo-spec-j2ee-deployment
>          geronimo-spec-j2ee-jacc
>          geronimo-spec-j2ee-management
>          geronimo-spec-jta
>          geronimo-spec-servlet
>          geronimo-system
>          geronimo-transaction
> 
> To make these projects into bundles I added OSGi meta-data into a manifest
> file.  This defines the dependencies of the bundle.  As an example here is
> the manifest for geronimo-common:
> 
>       Manifest-Version: 1.0
>       Bundle-ManifestVersion: 2
>       Bundle-Name: geronimo-common
>       Bundle-SymbolicName: geronimo_common
>       Bundle-Version: 1.0.0
>       Bundle-Localization: plugin
>       Import-Package:
>        javax.management,
>        org.apache.geronimo.kernel,
>        org.apache.xmlbeans
>       Export-Package:
>        org.apache.geronimo.common,
>        org.apache.geronimo.common.propertyeditor
>       Bundle-ClassPath: bin/, .
> 
> In addition to this I had the OSGi system bundle from Eclipse
> (org.eclipse.osgi) - I just used the latest version from HEAD in the
> Eclipse CVS repository (anonymous pserver access to
> 'dev.eclipse.org:/home/eclipse'), though any version (3.1 or later) should
> be ok (binaries of the OSGi framework are available from
> http://download.eclipse.org/eclipse/equinox).
> 
> Geronimo is dependant on quite a lot of non-Geronimo code (e.g.
> commons-logging, mx4j, etc), and so I grouped all of these jars into a
> single bundle (called 'other') and set up some appropriate meta-data for
> it.  I also had to add in 2 more jars to this project - one with
> org.objectweb.asm, and one containing the JSR173 packages.
> 
> As I mentioned earlier there were a couple of minor changes to Geronimo (in
> geronimo-system).  The first was in
> org.apache.geronimo.system.main.Daemon.doStartup().  I was getting a
> failure from some of the code in here because "startup-jar" does not
> contain a manifest.  I'm not sure how this would normally work.  I just
> commented out the lines that used the manifest.  The other change was to
> the static initializer in
> org.apache.geronimo.system.serverinfo.DirectoryUtils.  It was using a
> JarURLConnection, but running in OSGi, it gets returned a
> BundleURLConnection, so I modified it to use this instead.  Finally I added
> a bundle activator to geronimo-system so that the bundle could be started.
> This activator simply calls the main() method in Daemon.
> 
> Once all this had been done I could start up Geronimo on OSGi (using either
> the Eclipse OSGi console or my own launcher program).  I can make this work
> available if people are interested.
> 
> Simon.
> 
> 

Re: Modularizing Geronimo using OSGi

Posted by Simon Burns <si...@uk.ibm.com>.
Ok great.  Basically I have about 20 Eclipse projects for this (one for
each bundle) - is there somewhere I can upload these to?

Equinox is available as a separate download under the EPL (this is the OSGi
binary download I mentioned).  You can also get the OSGi framework with
Eclipse (3.1+) or from the CVS repository (the Equinox work is integrated
into Eclipse now).

Simon.




                                                                           
             "Geir Magnusson                                               
             Jr."                                                          
             <geirm@apache.org                                          To 
             >                         dev@geronimo.apache.org             
                                                                        cc 
             25/10/2005 12:53                                              
                                                                   Subject 
                                       Re: Modularizing Geronimo using     
             Please respond to         OSGi                                
                    dev                                                    
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





On Oct 25, 2005, at 7:33 AM, Simon Burns wrote:

> I worked on the Eclipse Equinox project to bring the OSGi framework
> up to
> the OSGi R4 specification.  As part of that I did some prototyping of
> Geronimo on OSGi.  I have recently revisited this work and have got
> Geronimo starting successfully on OSGi.  Since there has been some
> discussion of Geronimo and OSGi on this mailing list recently I
> thought it
> might be useful to post what I have done.

This is great.  Is Equinox a separable download?  I assume it's under
the EPL?

>
> I started with Geronimo milestone build M4 (the latest build when I
> started).  Apart from a couple of minor changes, the Geronimo code is
> untouched.  This means that it is still using the GBean framework
> within
> OSGi.  There were no changes to the OSGi framework.
>
> The OSGi bundles (listed below) directly map to the Geronimo jars:
>
>          geronimo-common
>          geronimo-core
>          geronimo-deploy-config
>          geronimo-deployment
>          geronimo-j2ee
>          geronimo-j2ee-schema
>          geronimo-kernel
>          geronimo-management
>          geronimo-naming
>          geronimo-spec-ejb
>          geronimo-spec-j2ee-connector
>          geronimo-spec-j2ee-deployment
>          geronimo-spec-j2ee-jacc
>          geronimo-spec-j2ee-management
>          geronimo-spec-jta
>          geronimo-spec-servlet
>          geronimo-system
>          geronimo-transaction
>
> To make these projects into bundles I added OSGi meta-data into a
> manifest
> file.  This defines the dependencies of the bundle.  As an example
> here is
> the manifest for geronimo-common:
>
>       Manifest-Version: 1.0
>       Bundle-ManifestVersion: 2
>       Bundle-Name: geronimo-common
>       Bundle-SymbolicName: geronimo_common
>       Bundle-Version: 1.0.0
>       Bundle-Localization: plugin
>       Import-Package:
>        javax.management,
>        org.apache.geronimo.kernel,
>        org.apache.xmlbeans
>       Export-Package:
>        org.apache.geronimo.common,
>        org.apache.geronimo.common.propertyeditor
>       Bundle-ClassPath: bin/, .
>
> In addition to this I had the OSGi system bundle from Eclipse
> (org.eclipse.osgi) - I just used the latest version from HEAD in the
> Eclipse CVS repository (anonymous pserver access to
> 'dev.eclipse.org:/home/eclipse'), though any version (3.1 or later)
> should
> be ok (binaries of the OSGi framework are available from
> http://download.eclipse.org/eclipse/equinox).
>
> Geronimo is dependant on quite a lot of non-Geronimo code (e.g.
> commons-logging, mx4j, etc), and so I grouped all of these jars into a
> single bundle (called 'other') and set up some appropriate meta-
> data for
> it.  I also had to add in 2 more jars to this project - one with
> org.objectweb.asm, and one containing the JSR173 packages.
>
> As I mentioned earlier there were a couple of minor changes to
> Geronimo (in
> geronimo-system).  The first was in
> org.apache.geronimo.system.main.Daemon.doStartup().  I was getting a
> failure from some of the code in here because "startup-jar" does not
> contain a manifest.  I'm not sure how this would normally work.  I
> just
> commented out the lines that used the manifest.  The other change
> was to
> the static initializer in
> org.apache.geronimo.system.serverinfo.DirectoryUtils.  It was using a
> JarURLConnection, but running in OSGi, it gets returned a
> BundleURLConnection, so I modified it to use this instead.  Finally
> I added
> a bundle activator to geronimo-system so that the bundle could be
> started.
> This activator simply calls the main() method in Daemon.
>
> Once all this had been done I could start up Geronimo on OSGi
> (using either
> the Eclipse OSGi console or my own launcher program).  I can make
> this work
> available if people are interested.

I'm very interested.  We've been talking about OSGi forever it seems
(I think Dain said he's been playing with it...) but it would be nice
to have something tangible for us to play with.  For me, it makes
things more real when I can diddle with it.

Contribution very welcome.  Thanks

geir

--
Geir Magnusson Jr                                  +1-203-665-6437
geirm@apache.org





Re: Modularizing Geronimo using OSGi

Posted by "Geir Magnusson Jr." <ge...@apache.org>.
On Oct 25, 2005, at 7:33 AM, Simon Burns wrote:

> I worked on the Eclipse Equinox project to bring the OSGi framework  
> up to
> the OSGi R4 specification.  As part of that I did some prototyping of
> Geronimo on OSGi.  I have recently revisited this work and have got
> Geronimo starting successfully on OSGi.  Since there has been some
> discussion of Geronimo and OSGi on this mailing list recently I  
> thought it
> might be useful to post what I have done.

This is great.  Is Equinox a separable download?  I assume it's under  
the EPL?

>
> I started with Geronimo milestone build M4 (the latest build when I
> started).  Apart from a couple of minor changes, the Geronimo code is
> untouched.  This means that it is still using the GBean framework  
> within
> OSGi.  There were no changes to the OSGi framework.
>
> The OSGi bundles (listed below) directly map to the Geronimo jars:
>
>          geronimo-common
>          geronimo-core
>          geronimo-deploy-config
>          geronimo-deployment
>          geronimo-j2ee
>          geronimo-j2ee-schema
>          geronimo-kernel
>          geronimo-management
>          geronimo-naming
>          geronimo-spec-ejb
>          geronimo-spec-j2ee-connector
>          geronimo-spec-j2ee-deployment
>          geronimo-spec-j2ee-jacc
>          geronimo-spec-j2ee-management
>          geronimo-spec-jta
>          geronimo-spec-servlet
>          geronimo-system
>          geronimo-transaction
>
> To make these projects into bundles I added OSGi meta-data into a  
> manifest
> file.  This defines the dependencies of the bundle.  As an example  
> here is
> the manifest for geronimo-common:
>
>       Manifest-Version: 1.0
>       Bundle-ManifestVersion: 2
>       Bundle-Name: geronimo-common
>       Bundle-SymbolicName: geronimo_common
>       Bundle-Version: 1.0.0
>       Bundle-Localization: plugin
>       Import-Package:
>        javax.management,
>        org.apache.geronimo.kernel,
>        org.apache.xmlbeans
>       Export-Package:
>        org.apache.geronimo.common,
>        org.apache.geronimo.common.propertyeditor
>       Bundle-ClassPath: bin/, .
>
> In addition to this I had the OSGi system bundle from Eclipse
> (org.eclipse.osgi) - I just used the latest version from HEAD in the
> Eclipse CVS repository (anonymous pserver access to
> 'dev.eclipse.org:/home/eclipse'), though any version (3.1 or later)  
> should
> be ok (binaries of the OSGi framework are available from
> http://download.eclipse.org/eclipse/equinox).
>
> Geronimo is dependant on quite a lot of non-Geronimo code (e.g.
> commons-logging, mx4j, etc), and so I grouped all of these jars into a
> single bundle (called 'other') and set up some appropriate meta- 
> data for
> it.  I also had to add in 2 more jars to this project - one with
> org.objectweb.asm, and one containing the JSR173 packages.
>
> As I mentioned earlier there were a couple of minor changes to  
> Geronimo (in
> geronimo-system).  The first was in
> org.apache.geronimo.system.main.Daemon.doStartup().  I was getting a
> failure from some of the code in here because "startup-jar" does not
> contain a manifest.  I'm not sure how this would normally work.  I  
> just
> commented out the lines that used the manifest.  The other change  
> was to
> the static initializer in
> org.apache.geronimo.system.serverinfo.DirectoryUtils.  It was using a
> JarURLConnection, but running in OSGi, it gets returned a
> BundleURLConnection, so I modified it to use this instead.  Finally  
> I added
> a bundle activator to geronimo-system so that the bundle could be  
> started.
> This activator simply calls the main() method in Daemon.
>
> Once all this had been done I could start up Geronimo on OSGi  
> (using either
> the Eclipse OSGi console or my own launcher program).  I can make  
> this work
> available if people are interested.

I'm very interested.  We've been talking about OSGi forever it seems  
(I think Dain said he's been playing with it...) but it would be nice  
to have something tangible for us to play with.  For me, it makes  
things more real when I can diddle with it.

Contribution very welcome.  Thanks

geir

-- 
Geir Magnusson Jr                                  +1-203-665-6437
geirm@apache.org