[ 
https://issues.apache.org/jira/browse/KARAF-6356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16935047#comment-16935047
 ] 

Jean-Baptiste Onofré commented on KARAF-6356:
---------------------------------------------

The problem comes from Felix {{TypedProperties}}. For instance, the following 
code creates {{I"9999"}} instead of {{"9999"}} or {{9999}}:

{code}
        TypedProperties typedProperties = new TypedProperties();
        typedProperties.put("sshPort", 9999);
        typedProperties.save(new File("/home/jbonofre/test.properties"));
{code}

I'm testing a possible workaround.

> Using instance commands corrupts org.apache.karaf.shell.cfg
> -----------------------------------------------------------
>
>                 Key: KARAF-6356
>                 URL: https://issues.apache.org/jira/browse/KARAF-6356
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.6
>         Environment: Observed on windows 10, java 1.8.0_201 (64bit)
>            Reporter: Jamie Kemp
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 4.3.0, 4.2.7
>
>
> Can be triggered by both forms of invoking instance commands. From the OS 
> shell:
>  # Call bin/instance create <name>
>  # Call bin/instance ssh-port-change <name> <port>
> Or via the karaf shell using:
>  # instance:create <name>
>  # instance:ssh-port-change <name> <port>
>  In both cases, post step 2) any variables defined within 
> org.apache.karaf.shell.cfg (e.g. ${karaf.etc} within the hostKey definition) 
> will be replaced with their literal value. In the case of the shell command 
> the path ends up with no backslashes at all:
> {code:java}
> hostKey = "D:Testapache-karaf-4.2.6etc/host.key"
> {code}
> From the commands run from the root instance its a slight variance:
> {code:java}
> hostKey = "D:\\Test\\apache-karaf-4.2.6\\etc/host.key"
> {code}
> There are however other problems. The changed sshPort has a leading I prefix 
> and is quoted:
> {code:java}
> sshPort = I"8104"
> {code}
> Other entries also gain quotes. This results in various exceptions visible in 
> the log related to number format exceptions.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to