I will wrap up my experience at eclipsecon. This was my first time at eclipsecon. Folks who had been here earlier told me that this year there was a lot of topics around eclipse runtime projects – so the focus has shifted from tools to runtime. Overall I liked eclipsecon.

My topic, OSGi & Java EE in GlassFish, was also of the same type. The slides of my talk are available here. The source code for the sample used to demonstrate “Modularized Enterprise Java Application” running in GlassFish is now available here. Just download, unzip and run it following the steps listed below.


The sample is organized as shown in the UML diagram below:


Features of the sample

All the components including the EJB are deployed as separate OSGi bundle.

EJB uses JPA in container managed mode to communicate with the database.

Both the admin client and Web Application Bundle client use the EJB via OSGi service registry.

Deployment order of bundles is irrelevant.

Local EJBs being accessed from other bundles.


Steps to run the sample:

asadmin start-domain

cp osgi-ejb-container.jar osgi-jpa,jar from maven repo to ${glassfish.home}/modules//autostart/

asadmin start-database

unzip ejb-as-service.zip

cd ./ejb-as-service

mvn clean install

cp ./common/target/hybridapp2-common.jar ./client/target/hybridapp2-client.jar ./service/target/hybridapp2-service.jar ./webclient/target/hybridapp2-webclient.war $glassfish.home/domains/domain1/autodeploy/bundles/

Open http://localhost:8080/eclipsecon/


Look at the source code, the metadata in jar files, and experiment. If you have any questions about OSGi & Java EE, send emails to users@glassfish.dev.java.net.