Karaf Pax 考试因未知协议失败:wrap

Karaf Pax Exam fails with Unknown protocol: wrap

嗨,我的 pax 考试失败,出现错误 Unknown protocol: wrap

org.apache.karaf.features.internal.util.MultiException: Error
    at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:84)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:363)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:360)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:187)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1089)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.service.FeaturesServiceImpl.call(FeaturesServiceImpl.java:985)[9:org.apache.karaf.features.core:4.0.4]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
Caused by: java.io.IOException: Error downloading wrap:file:/C:/Users/609620968/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
    at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:67)[9:org.apache.karaf.features.core:4.0.4]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_79]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:178)[:1.7.0_79]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_79]
    ... 3 more
Caused by: java.io.IOException: Could not download [wrap:file:/C:/Users/609620968/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar]
    at org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:90)[9:org.apache.karaf.features.core:4.0.4]
    at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:58)[9:org.apache.karaf.features.core:4.0.4]
    ... 7 more
Caused by: java.net.MalformedURLException: Unknown protocol: wrap
    at java.net.URL.<init>(URL.java:619)[:1.7.0_79]
    at java.net.URL.<init>(URL.java:482)[:1.7.0_79]
    at java.net.URL.<init>(URL.java:431)[:1.7.0_79]
    at org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:62)[9:org.apache.karaf.features.core:4.0.4]
    ... 8 more

当我将 karaf 版本从 3.03 更改为 4.04 时,此错误开始出现

您自己的功能需要依赖于包装功能。前提条件="true".

<feature prerequisite="true">wrap</feature>

这告诉 karaf 解析器首先加载包装功能,然后才尝试解析您的功能。