Use an OSGi console
Eclipse Equinox currently provides an OSGi console we can leverage to aid with debugging. This console is not available by default. When we work with the Liberty profile, we can enable this console by configuring a port for it.
The Liberty profile uses the Eclipse Equinox implementation of the OSGi core specification. Equinox currently provides an OSGi console. To enable this console, you first allocate a specific port to it by setting the osgi.console property in bootstrap.properties. Then we can use Telnet to connect to the console on that port, and explore the OSGi framework.
- Add the osgiConsole-1.0 Liberty feature to server.xml.
<feature>osgiConsole-1.0</feature>
- Allocate a specific port to the OSGi console.
You set the OSGi console port by specifying the osgi.console property. You set this property as a bootstrap property in bootstrap.properties. See Specify Liberty profile bootstrap properties.
osgi.console=5471
The OSGi console is disabled when the osgi.console property is not set.
- Use Telnet to connect to the OSGi console port.
telnet localhost 5471
- Use the console to explore the framework.
The available commands vary, depending on the OSGi framework being used. Command-line help provides enough information to get started.
Parent topic: Administer the Liberty profile from the command promptTasks:
Packaging a Liberty profile server from the command prompt Reference:
Explore Eclipse's OSGi console