karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Kuhtz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-3961) Reference to generated featuresRepositories is invalid on Windows
Date Fri, 09 Oct 2015 16:13:26 GMT

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

Andreas Kuhtz commented on KARAF-3961:
--------------------------------------

I used 4.0.1 to generate my custom distribution. The file {{etc/org.apache.karaf.features.cfg}}
is generated by the {{karaf-maven-plugin}} and contains the following line:
{code}
#
# Comma separated list of features repositories to register by default
#
featuresRepositories = file:${karaf.home}/etc/0d05ff05-4208-4e0a-95e7-6b41bca544e7.xml
{code}

The {{karaf.home}} is set by the generated {{bin/karaf.bat}} and on Windows it's a path like
{{file:D:\sample-karaf}}. The problem are the {{\}} instead of {{/}.
If I replace the whole line with
{code}
featuresRepositories = file:D:/sample-karaf/etc/0d05ff05-4208-4e0a-95e7-6b41bca544e7.xml
{code}
the startup passes.

{code}
<plugin>
   <groupId>org.apache.karaf.tooling</groupId>
   <artifactId>karaf-maven-plugin</artifactId>
   <version>${apache-karaf.version}</version>
   <executions>
      <execution>
         <id>install-kar</id>
         <phase>compile</phase>
         <goals>
            <goal>assembly</goal>
         </goals>
      </execution>
      <execution>
         <id>package</id>
         <goals>
            <goal>archive</goal>
         </goals>
      </execution>
   </executions>
   <configuration>
      <baseName>custom-karaf</baseName>
      <targetFile>custom-karaf-${project.artifactId}</targetFile>
      <archiveTarGz>false</archiveTarGz>
      <includeMvnBasedDescriptors>true</includeMvnBasedDescriptors>
      <bootFeatures>
                        <feature>wrap</feature>
                        <feature>aries-blueprint</feature>
                        <feature>shell</feature>
                        <feature>shell-compat</feature>
                        <feature>feature</feature>
                        <feature>jaas</feature>
                        <feature>ssh</feature>
                        <feature>management</feature>
                        <feature>bundle</feature>
                        <feature>config</feature>
                        <feature>deployer</feature>
                        <feature>diagnostic</feature>
                        <feature>feature</feature>
                        <feature>instance</feature>
                        <feature>kar</feature>
                        <feature>log</feature>
                        <feature>package</feature>
                        <feature>service</feature>
                        <feature>system</feature>
      </bootFeatures>
      <!-- the installedFeatures -->
      <installedFeatures>
         <feature>.... some of my features ....</feature>
      </installedFeatures>
      <libraries>
         <library>xerces-${xerces.version}.jar;url:="wrap:mvn:xerces/xercesImpl/${xerces.version}$Export-Package=org.apache.*;version=${xerces.version}";type:=endorsed;export:=true;delegate:=true</library>
         .... more libraries ....
      </libraries>
   </configuration>
</plugin>
{code}

> Reference to generated featuresRepositories is invalid on Windows
> -----------------------------------------------------------------
>
>                 Key: KARAF-3961
>                 URL: https://issues.apache.org/jira/browse/KARAF-3961
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-tooling
>    Affects Versions: 4.0.1
>         Environment: Windows 7
>            Reporter: Andreas Kuhtz
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 4.0.3
>
>
> The reference to the featuresRepositories generated by the karaf-maven-plugin is invalid
on Windows in {{org.apache.karaf.features.cfg}}. 
> The backslashes in {{karaf.home}} should be converted to forward slashes.
> {noformat} featuresRepositories = file:${karaf.home}/etc/0d05ff05-4208-4e0a-95e7-6b41bca544e7.xml
{noformat}
> {code}
> 2015-08-27 16:33:01,031 ERROR [org.apache.karaf.features.internal.service.BootFeaturesInstaller]
(pool-1-thread-1) Error installing boot feature repository file:D:\sample-karaf/etc/0fef08a9-7cfd-48ff-ac51-22669230cb44.xml
> java.lang.IllegalArgumentException: Illegal character in opaque part at index 7: file:D:\sample-karaf/etc/0fef08a9-7cfd-48ff-ac51-22669230cb44.xml
> 	at java.net.URI.create(URI.java:859)[:1.7.0_65]
> 	at org.apache.karaf.features.internal.service.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:86)[6:org.apache.karaf.features.core:4.0.1]
> 	at org.apache.karaf.features.internal.service.BootFeaturesInstaller.start(BootFeaturesInstaller.java:76)[6:org.apache.karaf.features.core:4.0.1]
> 	at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:257)[6:org.apache.karaf.features.core:4.0.1]
> 	at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:233)[6:org.apache.karaf.features.core:4.0.1]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_65]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_65]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_65]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_65]
> 	at java.lang.Thread.run(Thread.java:745)[:1.7.0_65]
> Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 7:
file:D:\sample-karaf/etc/0fef08a9-7cfd-48ff-ac51-22669230cb44.xml
> 	at java.net.URI$Parser.fail(URI.java:2829)[:1.7.0_65]
> 	at java.net.URI$Parser.checkChars(URI.java:3002)[:1.7.0_65]
> 	at java.net.URI$Parser.parse(URI.java:3039)[:1.7.0_65]
> 	at java.net.URI.<init>(URI.java:595)[:1.7.0_65]
> 	at java.net.URI.create(URI.java:857)[:1.7.0_65]
> 	... 9 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message