0

我正在尝试在 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 ”。

片段包: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 版本(独立和结构)中运行良好。

4

2 回答 2

1

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

于 2017-03-17T06:10:22.440 回答
0

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

后来发现/etc/custom.properties文件中存在另一个名为“ 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
于 2017-03-22T17:19:06.910 回答