EHCache CacheManager with RMI Clustering does not start in Fuse

Solution Unverified - Updated -

Issue

  • EHCache functionality is included in Fuse:
Apache ServiceMix :: Bundles :: ehcache (192)
---------------------------------------------
...
Bundle-Name = Apache ServiceMix :: Bundles :: ehcache
Bundle-Description = This OSGi bundle wraps ehcache 2.5.1 jar file.
Bundle-SymbolicName = org.apache.servicemix.bundles.ehcache
Bundle-Version = 2.5.1.1

And it works fine in a non-clustered environment. However when we enable RMI replication, the bundle fails to start.

  • The offending class does exist in the classpath:
JBossFuse:karaf@root> list -t 1 | grep ehcache
[ 192] [Active     ] [            ] [       ] [   40] Apache ServiceMix :: Bundles :: ehcache (2.5.1.1)
JBossFuse:karaf@root> classes 192 | grep RMICachePeer_Stub
You are about to access system bundle 192.  Do you wish to continue (yes/no): yes
net/sf/ehcache/distribution/RMICachePeer_Stub.class
JBossFuse:karaf@root> headers 192 | grep net.sf.ehcache.distribution
You are about to access system bundle 192.  Do you wish to continue (yes/no): yes
            net.sf.ehcache.distribution,
            net.sf.ehcache.distribution,
            net.sf.ehcache.distribution,
    net.sf.ehcache.distribution;uses:="net.sf.ehcache.event,net.sf.ehcache,org.slf4j,net.sf.ehcache.util,net.sf.ehcache.bootstrap,net.sf.ehcache.config";version=2.5.1,
            net.sf.ehcache.distribution,
            net.sf.ehcache.distribution,
    net.sf.ehcache.distribution.jms;
            net.sf.ehcache.distribution,
            net.sf.ehcache.distribution,

This issue is specific to Fuse as EHCache RMI clustering works outside Fuse runtime. Also this has been tested on an actual cluster, with the correct rmiUrls supplied to each node, with identical unsuccessful results.

  • Here is our current patch level:
[name]                                   [installed] [description]
jboss-fuse-6.1.0.redhat-379-r2           true       JBoss Fuse 6.1 R2
jboss-fuse-6.1.1.redhat-442-r2p6         true       JBoss Fuse 6.1 R2P6
  • Here's the trace for logs:
Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.distribution.RMICachePeer_Stub (no security manager: RMI class loader disabled)

    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:393)

    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:185)

    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)

    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)

    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:214)

    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612)

    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
  • Following error is thrown upon boot when uncommenting the properties in etc/system.properties on JBoss Fuse 6.2.1
Please wait while JBoss Fuse is loading...
ERROR: Unable to resolve 0 (java.lang.IllegalArgumentException: name can't be empty)
java.lang.IllegalArgumentException: name can't be empty
    at java.security.BasicPermission.init(BasicPermission.java:98)
    at java.security.BasicPermission.<init>(BasicPermission.java:137)
    at org.osgi.framework.CapabilityPermission.<init>(CapabilityPermission.java:201)
    at org.osgi.framework.CapabilityPermission.<init>(CapabilityPermission.java:157)
    at org.apache.felix.framework.BundleWiringImpl.<init>(BundleWiringImpl.java:388)
    at org.apache.felix.framework.StatefulResolver.markResolvedRevisions(StatefulResolver.java:994)
    at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:429)
    at org.apache.felix.framework.Felix.init(Felix.java:692)
    at org.apache.karaf.main.Main.launch(Main.java:344)
    at org.apache.karaf.main.Main.main(Main.java:561)
Could not create framework: org.osgi.framework.BundleException: Unresolved constraint in System Bundle:null
org.osgi.framework.BundleException: Unresolved constraint in System Bundle:null
    at org.apache.felix.framework.Felix.init(Felix.java:701)
    at org.apache.karaf.main.Main.launch(Main.java:344)
    at org.apache.karaf.main.Main.main(Main.java:561)

Environment

  • Red Hat JBoss Fuse
    • 6.1.0
    • 6.2.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content