sh wso2server.sh -DosgiConsole
or even to the shell script itself. There are already numerous parameters in that file. By the way, the OSGI console also works on Windows, so where we mention shell script you can also read tbe batch (bat) file. In this blog I’ll explain how you can access WSO2 OSGI console using Telnet.
The OSGI console gives access to the internal machinery and is done on the command line of the CMD windows or terminal session. In case WSO2 runs in the foreground the carbon logs are also shown in the same window as the interaction with the OSGi bundles. When the WSO2 product runs in the background there is no OSGi console, the control is transferred directly to the command line again.
Using Telnet
But there is another option. You can actually start the OSGI console to be available on a specific port. Let’s say that we open it on port 2500. By doing that we can actually set up a telnet connection to the OSGI console and control the WSO2 instance.
The setup is simple. We use the windows environment to show this. So, we have a WSO2 API Manager on the desktop. We start the API Manager with the following command:
wso2server.bat -DosgiConsole=2500
This also means that we are now no longer able to type in commands in the command window. We need a telnet connection.
We start a telnet session by typing in telnet in the Search window in the task bar. This opens up a telnet session.
To show it works we type in lb (list bundles). We have complete control over the OSGI console as if we were running in the same window.
Purpose?
We can actually start all WSO2 products on different ports allowing low level access when necessary. However since telnet sessions are not encrypted they are a security risk for man in the middle attacks and other attacks. But it is good to know that you have an option with telnet.
If you have any questions about this blogpost contact us via the comments section below. View also our WSO2 Tutorials, webinars or white papers for more technical information. Need support? We do deliver WSO2 Product Support, WSO2 Development Support, WSO2 Operational Support and WSO2 Training Programs.