Hi Xilai, hi JB, thanks for looking into this. Will you consider backporting the fix to the karaf 2.4 line as well ?
Thanks and Regards, Michael 2015-02-02 10:14 GMT+01:00 Jean-Baptiste Onofré <[email protected]>: > Hi, > > I will do the fix (and the Jira). The purpose is to "automatically" get > the port, but it should not be a blocking statement (a try/catch with a > fallback would be better). > > Regards > JB > > On 02/02/2015 10:09 AM, XiLai Dai wrote: > >> Hi, >> >> Yes, this issue is reproducible even in Karaf 3.0.x. >> >> After looking into the org.apache.karaf.client.Main class of >> 2.4.x/3.0.x, it somehow try to read the ssh port from >> org.apache.karaf.shell.cfg at the beginning. >> >> Properties shellCfg = loadProps(new >> File(System.getProperty("karaf.etc"), "org.apache.karaf.shell.cfg")); >> >> String host = shellCfg.getProperty("sshHost", "localhost"); >> >> int port = Integer.parseInt(shellCfg.getProperty("sshPort", >> "8101")); >> >> it looks like a bug from regression, maybe it’s better to create a jira. >> >> Regards. >> >> Xilai Dai >> >> *From:*Michael Täschner [mailto:[email protected]] >> *Sent:* Thursday, January 29, 2015 6:44 PM >> *To:* user >> *Subject:* Problem connecting to Karaf/ServiceMix after upgrade from >> >> 2.3.x to 2.4.x >> >> Hi, >> >> recently we upgraded ServiceMix from 5.1.3 to 5.3.0 based on Karaf 2.3.x >> and 2.4.x respectively. We manage our own customized container where we >> centralize configurations in a custom.properties via property >> replacements. >> >> Example: etc/org.apache.karaf.shell.cfg >> >> sshPort = ${isb.sshPort} >> >> with etc/custom.properties >> >> isb.sshPort=8101 >> >> This worked correctly in karaf 2.3.x (ServiceMix 5.1.x). Unfortunately >> after upgrading to karaf 2.4.x (ServiceMix 5.3.0/1) we get following >> error on commandline when trying to connect to karaf shell: >> >> D:\work\servicemix\isb-smx-5.3.0\bin>client.bat -a 8101 -u smx -p smx >> >> Exception in thread "main" java.lang.NumberFormatException: For input >> string: "${isb.sshPort}" >> >> at >> java.lang.NumberFormatException.forInputString( >> NumberFormatException.java:65) >> >> at java.lang.Integer.parseInt(Integer.java:481) >> >> at java.lang.Integer.parseInt(Integer.java:527) >> >> at org.apache.karaf.client.Main.main(Main.java:58) >> >> The port is bound by the process (checked via netstat) but the "client" >> does not seem to be able to resolve the property replacement. This has >> been tested with both ServiceMix 5.3.0 /5.3.1 and the underlying karaf >> 2.4.0 /2.4.1 >> >> My question is now: Is this regression in release upgrade Karaf 2.3.x to >> 2.4.x or a result of the security mechanisms introduced with 2.4.0? If >> the latter, can I work around this? >> >> Thanks and Best Regards, >> >> Michael >> >> > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com >
