在Jboss Fuse 6.2.1(Fabric Managed)中安装hazelcast 3.6.5的问题

时间:2017-03-16 22:28:19

标签: apache-camel hazelcast apache-karaf fusefabric

我正在尝试在Jboss Fuse 6.2.1服务器(Fabric Managed)中安装hazelcast-all-3.6.5版本。安装后会抛出以下错误。

Unable to update agent org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] 
osgi.identity; osgi.identity=appid1-hazelcast; type=karaf.feature; version=0 
    [caused by: Unable to resolve appid1-hazelcast/3.0.1.release: missing requirement [appid1-hazelcast/3.0.1.release] 
osgi.identity; osgi.identity=com.hazelcast; type=osgi.bundle; version="[3.6.5,3.6.5]"; resolution:=mandatory 
    [caused by: Unable to resolve com.hazelcast/3.6.5: missing requirement [com.hazelcast/3.6.5] 
osgi.wiring.package; filter:="(osgi.wiring.package=sun.misc)"]] 

尝试安装片段包以暴露sun.misc包但出现以下错误“错误:资源没有uri ”。

Fragment bundle:mvn:com.diffplug.osgi / com.diffplug.osgi.extension.sun.misc / 0.0.0

2017-03-16 18:02:22,814 | INFO  | 2.0.1-1-thread-1 | Agent                            | 72 - io.fabric8.fabric-agent - 1.2.0.redhat-621166 |   null
2017-03-16 18:02:22,814 | ERROR | 2.0.1-1-thread-1 | DeploymentAgent                  | 72 - io.fabric8.fabric-agent - 1.2.0.redhat-621166 | Unable to update agent
java.lang.IllegalStateException: Resource has no uri
        at io.fabric8.agent.service.Deployer.getBundleInputStream(Deployer.java:1466)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
        at io.fabric8.agent.service.Deployer.deploy(Deployer.java:812)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
        at io.fabric8.agent.service.Agent.provision(Agent.java:366)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
        at io.fabric8.agent.service.Agent.provision(Agent.java:199)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
        at io.fabric8.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:733)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
        at io.fabric8.agent.DeploymentAgent$4.run(DeploymentAgent.java:289)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_55]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_55]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_55]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_55]
        at java.lang.Thread.run(Thread.java:745)[:1.7.0_55]

注意:同样的方法在Fuse 6.1.0版本(独立版和结构版)中都能正常工作。

2 个答案:

答案 0 :(得分:1)

您需要在jboss中激活对sun.misc.Unsafe包的访问权限。通常,OSGi框架具有一些配置,您可以在其中将软件包从系统类加载器启用到软件包(引导类委派)。虽然不知道它在fabric8中是如何工作的,但是这篇旧帖子在过去修复了它,猜测配置仍然是相同的:https://developer.jboss.org/message/884503#884503

答案 1 :(得分:0)

最初我已将 sun.misc 包附加到 org.osgi.framework.system.packages.extra ”属性> etc / config.properties 文件,但这并没有解决问题。 (这应该占90%的情况)。

后来发现在 / etc / custom中还有另一个名为“ org.osgi.framework.system.packages.extra ”的属性。属性文件,将sun.misc包添加到/etc/custom.properties文件修复了该问题。

# Branding
org.osgi.framework.system.packages.extra = org.apache.karaf.branding,com.sun.xml.bind.v2.model.core,sun.misc