You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Michael Täschner <m....@gmail.com> on 2015/01/29 11:43:42 UTC

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

Re: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by Michael Täschner <m....@gmail.com>.
Hi JB,

can confirm same issue with 4.0.3 - the property substitution is not
applied. I used "my.sshPort" in etc/custom.properties with sshPort =
${my.sshPort} in etc/org.apache.karaf.shell.cfg

I raised bug in Jira:
https://issues.apache.org/jira/browse/KARAF-4250

Best Regards,
Michael

2016-01-06 10:19 GMT+01:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Hi Michael,
>
> Does it happen only with 3.0.5 or also with 4.0.3 ?
>
> I don't think we have a Jira about that: can you create one please ?
>
> Thanks,
> Regards
> JB
>
> On 01/06/2016 10:16 AM, Michael Täschner wrote:
>
>> Hi,
>>
>>
>> https://issues.apache.org/jira/browse/KARAF-3494 and
>> https://issues.apache.org/jira/browse/KARAF-3962 have fixed the issue of
>> no property replacement for the "client" command but I still have the
>> same issue ("For input string: """) using the "instances" command when
>> substituting sshPort in etc/org.apache.karaf.shell.cfg. Does this need
>> the same fix ? (tested with Karaf 3.0.5)
>>
>> Thanks and Best Regards,
>> Michael
>>
>> 2015-02-02 18:47 GMT+01:00 Jean-Baptiste Onofré <jb@nanthrax.net
>> <ma...@nanthrax.net>>:
>>
>>
>>     I created the Jira:
>>
>>     https://issues.apache.org/jira/browse/KARAF-3494
>>
>>     I'm working on it.
>>
>>     Regards
>>     JB
>>
>>
>>     On 01/29/2015 11:43 AM, Michael Täschner wrote:
>>
>>         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é
>>     jbonofre@apache.org <ma...@apache.org>
>>     http://blog.nanthrax.net
>>     Talend - http://www.talend.com
>>
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Michael,

Does it happen only with 3.0.5 or also with 4.0.3 ?

I don't think we have a Jira about that: can you create one please ?

Thanks,
Regards
JB

On 01/06/2016 10:16 AM, Michael Täschner wrote:
> Hi,
>
>
> https://issues.apache.org/jira/browse/KARAF-3494 and
> https://issues.apache.org/jira/browse/KARAF-3962 have fixed the issue of
> no property replacement for the "client" command but I still have the
> same issue ("For input string: """) using the "instances" command when
> substituting sshPort in etc/org.apache.karaf.shell.cfg. Does this need
> the same fix ? (tested with Karaf 3.0.5)
>
> Thanks and Best Regards,
> Michael
>
> 2015-02-02 18:47 GMT+01:00 Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>>:
>
>     I created the Jira:
>
>     https://issues.apache.org/jira/browse/KARAF-3494
>
>     I'm working on it.
>
>     Regards
>     JB
>
>
>     On 01/29/2015 11:43 AM, Michael Täschner wrote:
>
>         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é
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by Michael Täschner <m....@gmail.com>.
Hi,


https://issues.apache.org/jira/browse/KARAF-3494 and
https://issues.apache.org/jira/browse/KARAF-3962 have fixed the issue of no
property replacement for the "client" command but I still have the same
issue ("For input string: """) using the "instances" command when
substituting sshPort in etc/org.apache.karaf.shell.cfg. Does this need the
same fix ? (tested with Karaf 3.0.5)

Thanks and Best Regards,
Michael

2015-02-02 18:47 GMT+01:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> I created the Jira:
>
> https://issues.apache.org/jira/browse/KARAF-3494
>
> I'm working on it.
>
> Regards
> JB
>
>
> On 01/29/2015 11:43 AM, Michael Täschner wrote:
>
>> 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é
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I created the Jira:

https://issues.apache.org/jira/browse/KARAF-3494

I'm working on it.

Regards
JB

On 01/29/2015 11:43 AM, Michael Täschner wrote:
> 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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Absolutely, I will fix on master, karaf-3.0.x, and karaf-2.x branches.

Regards
JB

On 02/02/2015 02:41 PM, Michael Täschner wrote:
> 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é <jb@nanthrax.net
> <ma...@nanthrax.net>>:
>
>     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:m.taeschner@gmail.com
>         <ma...@gmail.com>]
>         *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é
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by Michael Täschner <m....@gmail.com>.
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é <jb...@nanthrax.net>:

> 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:m.taeschner@gmail.com]
>> *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é
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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:m.taeschner@gmail.com]
> *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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

RE: Problem connecting to Karaf/ServiceMix after upgrade from 2.3.x to 2.4.x

Posted by XiLai Dai <xl...@talend.com>.
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:m.taeschner@gmail.com]
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