5 Replies Latest reply on Jun 2, 2008 3:41 PM by Brian Stansberry

    Acessing the TreeCache MBeans in JBossAS when the TreeCache

    George Wilk Newbie

      I am running clustered JBoss Cache 1.4.1 in JBossAS 4. JBoss Cache is running as an MBean configured via xml file deployed in the "deploy" directory. Next step in my development process is to deploy the cache configuration file inside the war file, so that it can be managed/deployed along with the rest of the application codebase.
      I followed instructions on this Wiki page: http://wiki.jboss.org/wiki/JBossCacheMBeans. Using the same configuration file, which works well for me when deployed in the "deploy" directory, I get the following stack trace when the treecache.startService(); is called:

      org.jgroups.ChannelException: unable to setup the protocol stack
      at org.jgroups.JChannel.init(JChannel.java:1273)
      at org.jgroups.JChannel.(JChannel.java:265)
      at org.jgroups.JChannel.(JChannel.java:248)
      at org.jboss.cache.TreeCache._createService(TreeCache.java:1474)
      at org.jboss.cache.TreeCache.startService(TreeCache.java:1529)

      Any help would be greatly appreciated.

      Cheers,
      ~george

        • 1. Re:  Acessing the TreeCache MBeans in JBossAS when the TreeC
          Manik Surtani Master

          That doesn't say much - any more detail, debug messages, etc? :-)

          • 2. Re:  Acessing the TreeCache MBeans in JBossAS when the TreeC
            George Wilk Newbie

            Yes, sure. Here is some more :)

            Could not start TreeCache!unable to setup the protocol stackorg.jgroups.ChannelException: unable to setup the protocol stack
            at com.cidc.commonservices.cache.TreeCacheSingleton.init(TreeCacheSingleton.java:45)
            at com.cidc.commonservices.cache.CacheControlListener.contextInitialized(CacheControlListener.java:24)
            ... 136 more
            Caused by: org.jgroups.ChannelException: unable to setup the protocol stack
            at org.jgroups.JChannel.init(JChannel.java:1273)
            at org.jgroups.JChannel.(JChannel.java:265)
            at org.jgroups.JChannel.(JChannel.java:248)
            at org.jboss.cache.TreeCache._createService(TreeCache.java:1474)
            at org.jboss.cache.TreeCache.startService(TreeCache.java:1529)
            at com.cidc.commonservices.cache.TreeCacheSingleton.init(TreeCacheSingleton.java:41)
            ... 137 more
            Caused by: java.lang.ClassCastException: org.jgroups.protocols.UDP
            at org.jgroups.stack.Configurator$ProtocolConfiguration.createLayer(Configurator.java:593)
            at org.jgroups.stack.Configurator$ProtocolConfiguration.access$000(Configurator.java:502)
            at org.jgroups.stack.Configurator.createProtocols(Configurator.java:283)
            at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:56)
            at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:180)
            at org.jgroups.JChannel.init(JChannel.java:1270)

            Please, let me know if you'd like to take a look at my config file.

            Thanks in advance,
            ~george

            • 3. Re:  Acessing the TreeCache MBeans in JBossAS when the TreeC
              Manik Surtani Master

              You say this is within your WAR file? Where is this picking up the JBoss Cache jars (and dependent jars) from?

              • 4. Re:  Acessing the TreeCache MBeans in JBossAS when the TreeC
                George Wilk Newbie

                That's got to be it. I don't have all of the dependent jars included in my WAR file. When I run the Cache as a globally deployed MBean it must have access to all the files in /server/all/lib directory, but when I run it from my WAR file it is missing the dependent jar files.

                Is there a way to make these missing dependent jar files available to my application without including them in my WAR file?

                • 5. Re:  Acessing the TreeCache MBeans in JBossAS when the TreeC
                  Brian Stansberry Master

                  I'd say it's more likely that you have jgroups.jar in your war. A ClassCastException in that location means there is more than one version of the org.jgroups.protocols.UDP class on the classpath.