我在karaf下运行pax考试时遇到问题。 在安装捆绑包
期间2015-05-20 14:16:42,644 | DEBUG | FelixStartLevel | BundleManager | 1 - org.apache.karaf.features.core - 3.0.0 | Checking file:/tmp/ops4j-store-anonymous-568188393605841387/tinybundles_c3beb06a2df3da75e08a1ae1a44c832cfbd034c0.bin
它在
中挂了一段时间org.apache.karaf.features.internal.BundleManager#waitForUrlHandler
寻找
(&(objectClass=org.osgi.service.url.URLStreamHandlerService)(url.handler.protocol=file))
这里是线程转储:
at java.lang.Object.wait(Object.java:-1)
at org.osgi.util.tracker.ServiceTracker.waitForService(ServiceTracker.java:499)
at org.apache.karaf.features.internal.BundleManager.waitForUrlHandler(BundleManager.java:229)
at org.apache.karaf.features.internal.BundleManager.getInputStreamForBundle(BundleManager.java:186)
at org.apache.karaf.features.internal.BundleManager.doInstallBundleIfNeeded(BundleManager.java:99)
at org.apache.karaf.features.internal.BundleManager.installBundleIfNeeded(BundleManager.java:90)
at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:523)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:383)
at org.apache.karaf.features.internal.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:92)
at org.apache.karaf.features.internal.BootFeaturesInstaller.start(BootFeaturesInstaller.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)
at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)
at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:681)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:378)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)
- locked <0xbb5> (a java.util.concurrent.atomic.AtomicBoolean)
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245)
at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235)
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)
at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)
at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695)
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2092)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1291)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
at java.lang.Thread.run(Thread.java:745)
我没有找到任何提供该服务的捆绑包=&gt;因此,每次安装tinybundle的文件夹时,我的测试都会挂起30秒。
我已经从目标文件夹手动启动了一个paxexam的karaf,我运行了service:list来查看哪些bundle可以提供URLStreamHandlerService服务但是没有任何url.handler.protocol =文件
service.id = 2
Provided by :
System Bundle (0)
Used by:
Apache Felix File Install (17)
Apache Aries JMX Core (225)
[org.osgi.service.url.URLStreamHandlerService]
service.id = 51
url.handler.protocol = feature
Provided by :
Apache Karaf :: Deployer :: Features (12)
[org.osgi.service.url.URLStreamHandlerService]
service.id = 15
url.handler.protocol = jardir
Provided by :
Apache Felix File Install (17)
[org.osgi.service.url.URLStreamHandlerService]
service.id = 42
url.handler.protocol = spring
Provided by :
Apache Karaf :: Deployer :: Spring (27)
[org.osgi.service.url.URLStreamHandlerService]
service.id = 45
url.handler.protocol = blueprint
Provided by :
Apache Karaf :: Deployer :: Blueprint (30)
[org.osgi.service.url.URLStreamHandlerService]
service.id = 4
url.handler.protocol = [wrap]
Provided by :
OPS4J Pax Url - wrap: (37)
[org.osgi.service.url.URLStreamHandlerService]
所以问题是:我怎样才能避免等待超时。我们真的需要URLStreamHandlerService服务,如果是,我该如何提供呢?