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

Guillaume Nodet edited comment on KARAF-5422 at 5/17/18 7:21 AM:
-----------------------------------------------------------------

The {{file:${karaf.xxx\}}} pattern is used in several places in Karaf, so we 
need to fix them all.  What does you simple fix look like ?  

A possible one could be to generate new properties for {{karaf.home.uri}}, 
{{karaf.data.uri}}, etc... and use those instead.  

Another one would be to do this transformation on the fly in the substitution 
layer using {{uri:karaf.home}}, but doing that everywhere would require the 
felix utils code to be modified.


was (Author: gnt):
The {{[file:$|file:///$]{karaf.xxx}}} pattern is used in several places in 
Karaf, so we need to fix them all.  What does you simple fix look like ?  

A possible one could be to generate new properties for {{karaf.home.uri}}, 
{{karaf.data.uri}}, etc... and use those instead.  

Another one would be to do this transformation on the fly in the substitution 
layer using {{uri:karaf.home}}, but doing that everywhere would require the 
felix utils code to be modified.

> Feature Repository with Spaces in Path
> --------------------------------------
>
>                 Key: KARAF-5422
>                 URL: https://issues.apache.org/jira/browse/KARAF-5422
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.0.6
>         Environment: OS:
> * OSX 10.12.6
> * CentOS 6
>            Reporter: Stephen Kahmann
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> We are generating a custom distribution with boot features using Maven. This 
> creates a features repo xml file (ff74b32b-4c34-43fc-9775-8a83173c4d65.xml) 
> in the $KARAF_HOME/etc directory. The feature is also listed in the 
> org.apache.karaf.features.cfg file:
> {code}
> #
> # Comma separated list of features repositories to register by default
> #
> featuresRepositories = 
> file:${karaf.home}/etc/ff74b32b-4c34-43fc-9775-8a83173c4d65.xml
> {code}
> This works great except for when the distribution is unzipped into a 
> directory with spaces somewhere in the path. This causes a URISyntaxException:
> {code}
> 2017-10-12 17:11:38,669 | ERROR | pool-7-thread-1  | BootFeaturesInstaller    
>         | 8 - org.apache.karaf.features.core - 4.0.6 | Error installing boot 
> feature repository file:/Users/stephen/workspace/dirname with 
> spaces/distribution-1.9.30-SNAPSHOT/etc/ff74b32b-4c34-43fc-9775-8a83173c4d65.xml
> java.lang.IllegalArgumentException: Illegal character in path at index 33: 
> file:/Users/stephen/workspace/dirname with 
> spaces/distribution-1.9.30-SNAPSHOT/etc/ff74b32b-4c34-43fc-9775-8a83173c4d65.xml
>     at java.net.URI.create(URI.java:852)[:1.8.0_131]
>     at 
> org.apache.karaf.features.internal.service.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:104)[8:org.apache.karaf.features.core:4.0.6]
>     at 
> org.apache.karaf.features.internal.service.BootFeaturesInstaller.start(BootFeaturesInstaller.java:93)[8:org.apache.karaf.features.core:4.0.6]
>     at 
> org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:260)[8:org.apache.karaf.features.core:4.0.6]
>     at 
> org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:236)[8:org.apache.karaf.features.core:4.0.6]
>     at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_131]
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
>     at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
> Caused by: java.net.URISyntaxException: Illegal character in path at index 
> 33: file:/Users/stephen/workspace/dirname with 
> spaces/distribution-1.9.30-SNAPSHOT/etc/ff74b32b-4c34-43fc-9775-8a83173c4d65.xml
>     at java.net.URI$Parser.fail(URI.java:2848)[:1.8.0_131]
>     at java.net.URI$Parser.checkChars(URI.java:3021)[:1.8.0_131]
>     at java.net.URI$Parser.parseHierarchical(URI.java:3105)[:1.8.0_131]
>     at java.net.URI$Parser.parse(URI.java:3053)[:1.8.0_131]
>     at java.net.URI.<init>(URI.java:588)[:1.8.0_131]
>     at java.net.URI.create(URI.java:850)[:1.8.0_131]
>     ... 9 more
> {code}
> Can anyone help with this?
> Thanks



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to