You can use the wsadmin-based OSGi Applications command-line console to explore or debug the bundles associated with a specific OSGi application or shared bundle framework.
The OSGi Applications command-line console is a set of wsadmin commands that you can use to explore or debug a specific set of bundles that is running on an application server. As an aid to debugging applications in a test environment, the console also includes commands to start and stop bundles.
Every OSGi application that is currently running is viewed by the command-line console as a separate framework. On each application server that is running an OSGi application, there is also one shared bundle framework.
To work with a framework that is currently running, you first connect to the framework.
-h | The host name of the target machine. For example, machine1.hursley.ibm.com. |
-o | The port number of the SOAP port of the target server. For example, 8880. |
-u | The user ID, if the wsadmin connection is secured. |
-p | The password, if the wsadmin connection is secured. |
install_dir/feature_packs/aries/bin/osgiApplicationConsole -h machine1.hursley.ibm.com -o 8880
You use the connect command to connect to a specific framework.
wsadmin>connect("com.ibm.ws.eba.helloWorldService.eba", "1.0.0", "wasNode1", "server1")
wsadmin>list()
If
you are connecting to an individual application server, the previous
command might generate the following system response:ID Bundle Version Node Server
0 SharedBundles 7.0.0 wasNode1 server1
1 com.ibm.ws.eba.helloWorldService.eba 1.0.0 wasNode1 server1
2 com.ibm.ws.eba.obr.fep.eba5.eba 1.0.0 wasNode1 server1
3 com.ibm.ws.eba.wab.componenttest 1.0.0 wasNode1 server1
wsadmin>connect(1)
If the command completes
successfully it generates the following system responses:CWSAJ0035I: Connecting to framework com.ibm.ws.eba.helloWorldService.eba_1.0.0 on node wasNode1 and server server1.
CWSAJ0036I: Successfully connected to framework com.ibm.ws.eba.helloWorldService.eba_1.0.0.
To connect to a different framework, run the connect command again. You do not need to disconnect from one framework before connecting to another framework.
wsadmin>list()
The previous command might generate
the following system response:ID Bundle Version Node Server
0 SharedBundles 7.0.0 wasNode1 server1
1 com.ibm.ws.eba.helloWorldService.eba 1.0.0 wasNode1 server1 <== Connected
2 com.ibm.ws.eba.obr.fep.eba5.eba 1.0.0 wasNode1 server1
3 com.ibm.ws.eba.wab.componenttest 1.0.0 wasNode1 server1
wsadmin>ss()
wsadmin>bundles()
Use the bundle command. Specify the ID of the bundle that you want to examine. The bundle ID values are one of the outputs of the ss command.
wsadmin>bundle(1)
Use the headers command. Specify the ID of the bundle that you want to examine. The bundle ID values are one of the outputs of the ss command.
wsadmin>headers(1)
wsadmin>packages()
wsadmin>packages(2)
wsadmin>packages("a.b.c")
wsadmin>services()
wsadmin>services(6)
wsadmin>services("&(prop1=1)(prop2=2)")
wsadmin>refresh()
Use the start command to start the bundle specified by a given bundle ID. The bundle ID values are one of the outputs of the ss command.
wsadmin>start(2)
Use the stop command to stop the bundle specified by a given bundle ID. The bundle ID values are one of the outputs of the ss command.
wsadmin>stop(2)
wsadmin>help()