Issue installing hazelcast 3.6.5 in Jboss Fuse 6.2.1 (Fabric Managed)

247 Views Asked by At

I'm trying to install hazelcast-all-3.6.5 version in Jboss Fuse 6.2.1 server (Fabric Managed). Upon installation it throws the following error.

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)"]] 

Tried installing fragment bundle to expose sun.misc package but got the following error "Error: Resource has no 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]

Note: The same approach works fine in Fuse 6.1.0 version (both standalone and fabric).

2

There are 2 best solutions below

0
On BEST ANSWER

Initially I have appended sun.misc package to "org.osgi.framework.system.packages.extra" property in etc/config.properties file, but this didn't solve the issue. (This should work 90% of the case) .

Later figured out that there was one another property named "org.osgi.framework.system.packages.extra" present in /etc/custom.properties file, adding sun.misc package to /etc/custom.properties file fixed the issue.

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

You need to activate access to sun.misc.Unsafe package in jboss. Normally the OSGi framework has some configuration where you can enable packages from the system classloader into bundles (boot class delegation). Not sure though how it exactly works in fabric8 but this older post fixed it in the past, guess the config is still the same: https://developer.jboss.org/message/884503#884503