karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5402) Fileinstall incorrectly parses .config files
Date Thu, 05 Oct 2017 07:46:00 GMT

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

Guillaume Nodet commented on KARAF-5402:
----------------------------------------

First, Karaf only supports typed config from 4.2 onward, see https://issues.apache.org/jira/browse/KARAF-5074.

Second, the config file syntax is incorrect, as non array values need to be quoted:
{code}
role.one.name="Operator"
role.two.name="Shadow"

role.one.permission=["permission1", "permission2", "permission3", "permission4", "permission5",
"permission6"]
role.two.permission=["permission1", "permission2", "permission3", "permission4", "permission5",
"permission6"]

permission.everything="EverythingBut"
{code}


> Fileinstall incorrectly parses .config files
> --------------------------------------------
>
>                 Key: KARAF-5402
>                 URL: https://issues.apache.org/jira/browse/KARAF-5402
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-config
>    Affects Versions: 4.0.8, 4.0.9, 4.0.10
>         Environment: Karaf 4.0.x
>            Reporter: Ɓukasz Dywicki
>            Assignee: Guillaume Nodet
>              Labels: configurationadmin, fileinstall, regresion
>         Attachments: com.example.role.config
>
>
> Support for array values encoded as strings inside of .config files is broken in given
Karaf versions. Reasons for that are different between them as Karaf 4.0.10 uses new version
of fileinstall, however result is the same - config values are always strings regardless of
correctness of value notation. Karaf 4.0.8 and 4.0.9 in general are broken due to bug in fileinstall
or config admin as they tend to override source configuration with some partia representation
malformed by configuration parser.
> For karaf 4.0.10, even if it uses fileinstall 3.6.0 there is no way, so far - to force
configuration to be typed.
> {code:title="Error message for fileinstall 3.5.x:"}
> java.io.IOException: Unexpected token 78; expected: 61 (line=39, pos=4)
> 	at org.apache.felix.cm.file.ConfigurationHandler.readFailure(ConfigurationHandler.java:650)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.cm.file.ConfigurationHandler.readInternal(ConfigurationHandler.java:274)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.cm.file.ConfigurationHandler.read(ConfigurationHandler.java:237)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:237)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:78)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:937)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:871)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:485)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)[4:org.apache.felix.fileinstall:3.5.4]
> 	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)[4:org.apache.felix.fileinstall:3.5.4]
> {code}
> Line 39 and position 4 is middle of property key.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message