Launching JOnAS on OSGi

Launching JOnAS/OSGi

This is a work in progress page.

Compile the launcher

Go into the 'modules/tools/launchers/felix-launcher'

>$ cd modules/tools/launchers/felix-launcher

Compile the launcher:

>$ mvn clean install
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building JOnAS :: Tools :: Launchers :: Felix
[INFO]    task-segment: [clean, install]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/sauthieg/workspaces/jonas.old/jonas/modules/tools/launchers/felix/target
[INFO] Deleting directory /home/sauthieg/workspaces/jonas.old/jonas/modules/tools/launchers/felix/target/classes
[INFO] Deleting directory /home/sauthieg/workspaces/jonas.old/jonas/modules/tools/launchers/felix/target/test-classes
[INFO] Deleting directory /home/sauthieg/workspaces/jonas.old/jonas/modules/tools/launchers/felix/target/site
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] [compiler:compile]
[INFO] Compiling 5 source files to /home/sauthieg/workspaces/jonas.old/jonas/modules/tools/launchers/felix/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] Resource directory does not exist: /home/sauthieg/workspaces/jonas.old/jonas/modules/tools/launchers/felix/src/test/resources
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [bundle:bundle]
[INFO] [install:install]
[INFO] Installing /home/sauthieg/workspaces/jonas.old/jonas/modules/tools/launchers/felix/target/felix-launcher-5.0.0-SNAPSHOT.jar to /home/sauthieg/.m2/repository/org/objectweb/jonas/launchers/felix-launcher/5.0.0-SNAPSHOT/felix-launcher-5.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Thu Aug 30 13:49:56 GMT+01:00 2007
[INFO] Final Memory: 12M/23M
[INFO] ------------------------------------------------------------------------

Execute

The execution is really easy:

>$ java -Djonas.base=$JONAS_BASE -jar $M2_LOCAL_REPO/org/objectweb/jonas/launchers/felix-launcher/5.0.0-SNAPSHOT/felix-launcher-5.0.0-SNAPSHOT.jar


Welcome to OW2 JOnAS (Running on Felix).
   Type 'help' for available commands.
-----------------------------------------------

Starting Naming Bundle...
Starting Carol Bundle...
-> Aug 30, 2007 1:51:55 PM org.objectweb.carol.util.configuration.TraceCarol infoCarol
INFO: Name service for jrmp is started on port 1980

Don't forget to set your jonas.base property, instead you will see an Exception coming from JProp:

java.lang.RuntimeException: JOnAS configuration error: environment property jonas.base not set!
        at org.ow2.jonas.lib.bootstrap.JProp.readFile(JProp.java:341)
        at org.ow2.jonas.lib.bootstrap.JProp.<init>(JProp.java:174)
        at org.ow2.jonas.lib.bootstrap.JProp.getInstance(JProp.java:202)
        at org.ow2.jonas.registry.carol.osgi.Activator.getConfiguration(Activator.java:54)
        at org.ow2.jonas.registry.carol.osgi.Activator.start(Activator.java:30)
        at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589)
        at org.apache.felix.framework.Felix._startBundle(Felix.java:1535)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1469)
        at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1064)
        at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
        at java.lang.Thread.run(Thread.java:595)

Felix usage

Please read the Felix usage document to be introduced to Felix Shell:

http://felix.apache.org/site/apache-felix-usage-documentation.html

Just type 'help' in the shell for available commands.

Thank You