product-apim icon indicating copy to clipboard operation
product-apim copied to clipboard

OSGI Console Over telnet doesn't work

Open dumindurox777 opened this issue 4 years ago • 5 comments

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:

  1. Start the server as follows. ./wso2server.sh -DosgiConsole=2500
  2. 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:

dumindurox777 avatar May 21 '20 07:05 dumindurox777

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.

ruwanta avatar May 22 '20 00:05 ruwanta

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);

kakash1hatake avatar Sep 09 '22 08:09 kakash1hatake

The problem occurs also in the APIM-4.0.0

kakash1hatake avatar Sep 09 '22 08:09 kakash1hatake

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

kakash1hatake avatar Sep 09 '22 08:09 kakash1hatake

@ruwanta It would be nice if this tiny bug was solved.

kakash1hatake avatar Sep 26 '22 05:09 kakash1hatake