The OSGI console can assist with development investigation and troubleshooting runtime errors. It’s worth becoming familiar with a few basic commands.
When using the Expeditor or Sametime client, append -console to the client shortcut. If you are using Notes, append -RPARAMS -console. For example, here is the Notes shortcut C:\notes\notes.exe -RPARAMS -console. After starting the client, the OSGI console will display in a separate window. Eclipse developers may already be familiar with the OSGI console. It’s often used during development, and the same commands listed below are applicable to Eclipse.
Commands can be input to the platform by typing the command next to the osgi> prompt. If you do not see the prompt simply press enter. For a complete list of commands available, type ? and then press enter.
If the client experiences a platform hang or crash, the following commands provide useful data to locate the cause.
dump heapgenerates a JVM heap dump which is useful when analyzing heap memory usage or memory leaks.
dump threadsgenerates a javacore which can be used to analyze the stack trace of various threads; it’s recommended to run dump threads several times and compare threads over time.
See IBM Thread and Monitor Dump Analyzer for Java for analyzing output from the dump commands. The location of dump output can be redirected by editing the rcpinstall.properties file.
When trying to isolate why a particular feature may be failing, it’s useful to start by understanding the bundle’s state. Is it installed, is it started, or has it failed to start? The OSGI console accepts either the bundle’s symbolic name or the bundle ID.
ssor short status list matching bundles and their state.
startstarts a bundle.
stopstops the bundle.
diagdetermines if the bundle has unresolved dependencies which could lead to runtime problems or an inability to use the bundle.
bundledisplays a verbose set of information related to exported packages, dependencies, etc.
To enable trace output or limit the amount use the following command.
setlogrlevdynamically adjusts log output provide the logger ID (normally the bundle’s symbolic name) and a level (FINEST, FINER, FINE, INFO, WARNING, CONFIG).
Here are a few examples of the above commands.
setlogrlev com.ibm.rcp.ui.launcher FINEST