product-apim
product-apim copied to clipboard
OSGI Console Over telnet doesn't work
Description:
We are facing the following error when trying to access the WSO2 OSGi console using Telnet.
Exception in thread "Thread-93" java.lang.NoSuchMethodError:
org.apache.felix.service.command.CommandProcessor.createSession(Ljava/io/InputStream;Ljava/io/OutputStream;Ljava/io/OutputStream;)Lorg/apache/felix/service/command/CommandSession;
Exception in thread "Thread-93" java.lang.NoSuchMethodError:
org.apache.felix.service.command.CommandProcessor.createSession(Ljava/io/InputStream;Ljava/io/OutputStream;Ljava/io/OutputStream;)Lorg/apache/felix/service/command/CommandSession;
at org.eclipse.equinox.console.telnet.TelnetConnection.run(TelnetConnection.java:90)
Steps to reproduce:
- Start the server as follows. ./wso2server.sh -DosgiConsole=2500
- Telnet the connection as follows telnet <ip_address> 2500
Affected Product Version:
Environment details (with versions):
- OS:
- Client:
- Env (Docker/K8s):
Optional Fields
Related Issues:
https://issues.apache.org/jira/browse/FELIX-6021
Suggested Labels:
Suggested Assignees:
OSGI console access via telnet is an undocumented and can not see a real requirement. Please use SSH on remote server to access the remote console itself. You can do any task via SSH.
I do not see any real requirement on this request.
I disagree, because accessing via telnet is officially documented in equinox
This feature is very convenient for debugging bundle loading problems in docker/k8s environments where container typically doesn't have sshd.
After some debugging I managed to make it working. The problem is in the org.eclipse.equinox.console_1.3.300.v20190516-1504.jar in the TelnetConnection.java:90 change line 90 from
CommandSession session = this.processor.createSession((InputStream)inp, output, output);
to
CommandSession session = this.processor.createSession((InputStream)inp, (PrintStream)output, (PrintStream)output);
The problem occurs also in the APIM-4.0.0
If someone wants to access console via ssh, then additional components needed to be deployed (they are not included into APIM) and additional configuration via properties
- org.apache.sshd.osgi
- org.eclipse.equinox.console.jaas.fragment
- org.eclipse.equinox.console.ssh
@ruwanta It would be nice if this tiny bug was solved.