java.lang.NoSuchMethodError exception trying to connect to OSGI Console
Description: NoSuchMethodError exception trying to connect to OSGI Console
Suggested Labels: Bug
Suggested Assignees:
Affected Product Version: 1.2.0
OS, DB, other environment details and versions: MacOS Catalina 10.15.7, JDK 1.8.0 revision 202
Steps to reproduce:
- Start micro-integrator enabling OSGI Console:
$ docker run -p 8290:8290 -p 9201:9201 -p 19444:19444 -e JAVA_OPTS="-DosgiConsole=19444" wso2/wso2mi:1.2.0
- Try to connect to OSGI Console:
$ telnet localhost 19444
In logs, I can see the exception as is given below:
[2021-03-02 15:14:31,277] WARN {org.wso2.config.mapper.ConfigParser} - Overriding files in configuration directory /home/wso2carbon/wso2mi-1.2.0
[2021-03-02 15:14:31,490] INFO {org.wso2.config.mapper.ConfigParser} - Applying configurations with deployment configurations
OSGi console has been enabled with options: -console 19444
[2021-03-02 15:14:33,821] INFO {EventAdminConfigurationNotifier} - Logging configuration changed. (Event Admin service unavailable - no notification sent).
Exception in thread "Thread-3" 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)
Related Issues:
The problem is that the versions of org.apache.felix.gogo bundles are wrong for 1.3.300.v20190516-1504 version of org.eclpse.equinox.console bundle.
I analyze that micro-integrator use equinox 4.12 and so the correct versions of org.apache.felix.gogo bundles are org.apache.felix.gogo.command_1.0.2.v20170914-1324.jar org.apache.felix.gogo.runtime_1.1.0.v20180713-1646.jar org.apache.felix.gogo.shell_1.1.0.v20180713-1646.jar as you can see at this link https://archive.eclipse.org/equinox/drops/R-4.12-201906051800/index.php.
I propose to fix those dependencies.
If you want to test this solution you can download correct bundles at https://download.eclipse.org/releases/2019-06/201905311000/plugins/, put these bundles into plugins folder and change bundle.info with
org.apache.felix.gogo.command,1.0.2.v20170914-1324,../plugins/org.apache.felix.gogo.command_1.0.2.v20170914-1324.jar,4,true org.apache.felix.gogo.runtime,1.1.0.v20180713-1646,../plugins/org.apache.felix.gogo.runtime_1.1.0.v20180713-1646.jar,4,true org.apache.felix.gogo.shell,1.1.0.v20180713-1646,../plugins/org.apache.felix.gogo.shell_1.1.0.v20180713-1646.jar,4,true
and then work!
Thanks peppeink, that's work fine for me and and also thanks for the proposal. It should be great to have OSGi working fine by default because of it is useful when you are working with mediators, handlers, etc.