Friday June 20, 2008
TOTD #34: Using Felix Shell with GlassFish
TOTD
#33 explains how to create a GlassFish v3
distribution that uses Apache Felix
(default) as the OSGi R4 Service
Platform runtime. This blog explains how to use Felix
Shell
TUI with that bundle to issue commands to the OSGi framework
and obtain information from it.
To enable Felix Shell with GlassFish v3, add the lines ...
| ${com.sun.aas.installRootURI}/felix/bundle/org.apache.felix.shell.jar
\ ${com.sun.aas.installRootURI}/felix/bundle/org.apache.felix.shell.tui.jar |
| felix.auto.start.1=
\ ${com.sun.aas.installRootURI}/modules/tiger-types-osgi-0.3.2.jar \ ${com.sun.aas.installRootURI}/modules/auto-depends-0.3.2.jar \ ${com.sun.aas.installRootURI}/modules/config-0.3.2.jar \ ${com.sun.aas.installRootURI}/modules/hk2-core-0.3.2.jar \ ${com.sun.aas.installRootURI}/modules/osgi-adapter-0.3.2.jar \ ${com.sun.aas.installRootURI}/felix/bundle/org.apache.felix.shell.jar \ ${com.sun.aas.installRootURI}/felix/bundle/org.apache.felix.shell.tui.jar |
| INFO:
Glassfish v3 started in 1624 ms Jun 16, 2008 7:10:37 PM INFO: -> Jun 16, 2008 7:10:37 PM com.sun.enterprise.glassfish.bootstrap.ASMainFelix launchOSGiFW INFO: Framework successfully started |
| help Jun 16, 2008 7:11:12 PM INFO: bundlelevel <level> <id> ... | <id> - set or get bundle start level. Jun 16, 2008 7:11:12 PM INFO: cd [<base-URL>] - change or display base URL. Jun 16, 2008 7:11:12 PM INFO: headers [<id> ...] - display bundle header properties. Jun 16, 2008 7:11:12 PM INFO: help - display impl commands. Jun 16, 2008 7:11:12 PM INFO: install <URL> [<URL> ...] - install bundle(s). Jun 16, 2008 7:11:12 PM INFO: packages [<id> ...] - list exported packages. Jun 16, 2008 7:11:12 PM INFO: ps [-l | -s | -u] - list installed bundles. Jun 16, 2008 7:11:12 PM INFO: refresh [<id> ...] - refresh packages. Jun 16, 2008 7:11:12 PM INFO: resolve [<id> ...] - attempt to resolve the specified bundles. Jun 16, 2008 7:11:12 PM INFO: services [-u] [-a] [<id> ...] - list registered or used services. Jun 16, 2008 7:11:12 PM INFO: shutdown - shutdown framework. Jun 16, 2008 7:11:12 PM INFO: start <id> [<id> <URL> ...] - start bundle(s). Jun 16, 2008 7:11:12 PM INFO: startlevel [<level>] - get or set framework start level. Jun 16, 2008 7:11:12 PM INFO: stop <id> [<id> ...] - stop bundle(s). Jun 16, 2008 7:11:12 PM INFO: uninstall <id> [<id> ...] - uninstall bundle(s). Jun 16, 2008 7:11:12 PM INFO: update <id> [<URL>] - update bundle. Jun 16, 2008 7:11:12 PM INFO: version - display version of framework. Jun 16, 2008 7:11:12 PM INFO: -> |
| ps Jun 16, 2008 7:13:57 PM INFO: START LEVEL 1 Jun 16, 2008 7:13:57 PM INFO: ID State Level Name Jun 16, 2008 7:13:57 PM INFO: [ 0] [Active ] [ 0] System Bundle (1.0.4) Jun 16, 2008 7:13:57 PM INFO: [ 1] [Active ] [ 1] org.jvnet.tiger-types repackaged as module (0.3.2) . . . INFO: [ 137] [Installed ] [ 1] WebTier Security Integration (10.0.0.SNAPSHOT) Jun 16, 2008 7:13:57 PM INFO: [ 138] [Installed ] [ 1] Web module command line interface (10.0.0.SNAPSHOT) Jun 16, 2008 7:13:57 PM INFO: [ 139] [Installed ] [ 1] Admin GUI Web Container Plugin (10.0.0.SNAPSHOT) Jun 16, 2008 7:13:57 PM INFO: -> |
Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive is available here.
Technorati: totd glassfish v3 felix osgiPosted by Arun Gupta in General | Comments[5]
|
|
|
|
|
Today's Page Hits: 4144
Total # blog entries: 1009
| « December 2009 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
5 | ||||||
6 | 8 | 9 | 10 | 11 | 12 | |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | ||
| Today | ||||||
Posted by Arun Gupta's Blog on June 26, 2008 at 06:17 AM PDT #
Hi, Arun
I tried to run felix console with glassfish tech. preview 2, but it does not pick it up.
Posted by Alexander on July 23, 2008 at 07:14 AM PDT #
Alexander, Felix is not the default shell for TP2. I started TP2 as:
java -DGlassFish_Platform=Felix -jar modules/glassfish-10.0-tp-2-SNAPSHOT.jar
after enabling Felix shell and then the prompt came fine.
Posted by Arun Gupta on July 28, 2008 at 11:10 AM PDT #
Sorry, I can't get this to work - I can't find felix/conf anywhere in the GFv3 source distribution. And I don't know what you mean by an "expanded bundle". Any help you can give would be most appreciated.
Posted by David Van Couvering on August 10, 2008 at 09:23 AM PDT #
David,
These instructions work with a binary bundle. http://blogs.sun.com/arungupta/entry/totd_33_building_glassfish_v3 explains how to create such a bundle using GlassFish v3 workspace. And then you can extract distributions/glassfish/target/glassfish-10.0-SNAPSHOT.zip or distributions/web/target/web.zip. Both of these bundles contain felix/conf directory.
Posted by Arun Gupta on August 10, 2008 at 03:11 PM PDT #