[
https://issues.apache.org/jira/browse/KARAF-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300236#comment-16300236
]
ASF GitHub Bot commented on KARAF-4662:
---------------------------------------
jbonofre closed pull request #433: [KARAF-4662] Trim bundle and config file
locations to avoid parsing i…
URL: https://github.com/apache/karaf/pull/433
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
index f7b6758f67..8ed5ff813a 100644
--- a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
+++ b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
@@ -401,22 +401,22 @@ private void copyFeatureToJar(JarOutputStream jos,
Feature feature, Map<URI, Int
throws URISyntaxException {
// add bundles
for (BundleInfo bundleInfo : feature.getBundles()) {
- URI location = new URI(bundleInfo.getLocation());
+ URI location = new URI(bundleInfo.getLocation().trim());
copyResourceToJar(jos, location, locationMap);
}
// add config files
for (ConfigFileInfo configFileInfo : feature.getConfigurationFiles()) {
- URI location = new URI(configFileInfo.getLocation());
+ URI location = new URI(configFileInfo.getLocation().trim());
copyResourceToJar(jos, location, locationMap);
}
// add bundles and config files in conditionals
for (Conditional conditional : feature.getConditional()) {
for (BundleInfo bundleInfo : conditional.getBundles()) {
- URI location = new URI(bundleInfo.getLocation());
+ URI location = new URI(bundleInfo.getLocation().trim());
copyResourceToJar(jos, location, locationMap);
}
for (ConfigFileInfo configFileInfo :
conditional.getConfigurationFiles()) {
- URI location = new URI(configFileInfo.getLocation());
+ URI location = new URI(configFileInfo.getLocation().trim());
copyResourceToJar(jos, location, locationMap);
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Unable to create Karaf Cave 4.0.0 Kar file
> ------------------------------------------
>
> Key: KARAF-4662
> URL: https://issues.apache.org/jira/browse/KARAF-4662
> Project: Karaf
> Issue Type: Bug
> Components: cave-server, karaf-kar
> Affects Versions: cave-4.0.0, 4.0.5
> Environment: Karaf 4.0.5 and Karaf Cave 4.0.0
> Reporter: Joel
> Assignee: Jean-Baptiste Onofré
> Fix For: cave-4.0.1, cave-4.1.0, 4.2.0, 4.1.5
>
>
> Unable to create a kar file from Karaf Cava 4.0.0 using kar:create command
> java.lang.RuntimeException: Error creating kar: Illegal character in scheme
> name at index 0:
> mvn:org.apache.karaf.cave/apache-karaf-cave/4.0.0/cfg/filesystem
> at
> org.apache.karaf.kar.internal.KarServiceImpl.create(KarServiceImpl.java:332)[37:org.apache.karaf.kar.core:4.0.5]
> at
> org.apache.karaf.kar.command.CreateKarCommand.execute(CreateKarCommand.java:46)[37:org.apache.karaf.kar.core:4.0.5]
> at
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[44:org.apache.karaf.shell.core:4.0.5]
> at
> org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:270)[44:org.apache.karaf.shell.core:4.0.5]
> at java.lang.Thread.run(Thread.java:745)[:1.8.0_60]
> Caused by: java.net.URISyntaxException: Illegal character in scheme name at
> index 0:
> mvn:org.apache.karaf.cave/apache-karaf-cave/4.0.0/cfg/filesystem
> at java.net.URI$Parser.fail(URI.java:2848)[:1.8.0_60]
> at java.net.URI$Parser.checkChars(URI.java:3021)[:1.8.0_60]
> at java.net.URI$Parser.checkChar(URI.java:3031)[:1.8.0_60]
> at java.net.URI$Parser.parse(URI.java:3047)[:1.8.0_60]
> at java.net.URI.<init>(URI.java:588)[:1.8.0_60]
> at
> org.apache.karaf.kar.internal.KarServiceImpl.copyFeatureToJar(KarServiceImpl.java:394)[37:org.apache.karaf.kar.core:4.0.5]
> at
> org.apache.karaf.kar.internal.KarServiceImpl.create(KarServiceImpl.java:326)[37:org.apache.karaf.kar.core:4.0.5]
> ... 12 more
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)