3 Replies Latest reply on Oct 1, 2008 11:02 AM by Kenny MacLeod

    Problems deploying POJO cache to JBoss AS 4.2.2.GA

    Pete Muir Master

      I'm trying to use POJO Cache with AS 4.2. If I deploy with just jgroups.jar, jbosscache-core.jar and jboss-aop.jar then I get a

      Caused by: java.lang.NoClassDefFoundError: org/jboss/metadata/spi/signature/Signature
       at org.jboss.cache.pojo.impl.PojoCacheImpl.<clinit>(PojoCacheImpl.java)
       at org.jboss.cache.pojo.PojoCacheFactory.createCache(PojoCacheFactory.java:29)
       at org.jboss.seam.core.PojoCache.start(PojoCache.java:42)


      I therefore included jboss-container.jar, and got this

      aused by: java.lang.NoClassDefFoundError: org/jboss/util/stream/MarshalledValueOutputStream
       at org.jboss.cache.CacheImpl.<init>(CacheImpl.java:206)
       at org.jboss.cache.DefaultCacheFactory.createAndWire(DefaultCacheFactory.java:115)
       at org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:95)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.init(PojoCacheImpl.java:75)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.<init>(PojoCacheImpl.java:58)
       at org.jboss.cache.pojo.PojoCacheFactory.createCache(PojoCacheFactory.java:29)
       at org.jboss.seam.core.PojoCache.start(PojoCache.java:42)
       ... 57 more


      I then tried to include jboss-common-core.jar but that causes a lot of other problems. And this really doesn't feel like the right approach to me.

      So, is there some docs I'm missing on using pojo cache 2.1 with AS 4.2? Or does it not work? I took a look at the compatibility matrix, but it doesn't really mention JBoss Cache 2.

        • 1. Re: Problems deploying POJO cache to JBoss AS 4.2.2.GA
          Mircea Markus Master

          We've tested JBossCache 2.x in AS 4.2 and wiki ok that one http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheAsCompatibility
          Never tried Pojo though, seems like it does not work as per your example.

          • 2. Re: Problems deploying POJO cache to JBoss AS 4.2.2.GA
            Brian Stansberry Master

            Thanks for the wiki link. :)

            You say that "The class loader isolation for each app ensures that user code can use JBC 2.x while the app server still uses 1.4.x for its own clustering." Recommend that you spell out how that class loader isolation was achieved -- that's the key piece of info readers need to understand.

            I'm guessing you did it just by putting JBC 2.x and all its dependencies in WEB-INF/lib and counting on the fact that a webapp uses a child-first classloader.

            Re: PojoCache vs core cache, when I look at the stack trace on http://www.jboss.com/index.html?module=bb&op=viewtopic&t=128465 I see it's failing in constructing a CacheImpl. That doesn't seem like something that would only fail in the PojoCache case. I suspect Pete hasn't done whatever you did to get the needed class loader isolation.

            • 3. Re: Problems deploying POJO cache to JBoss AS 4.2.2.GA
              Kenny MacLeod Newbie

              The JBossCacheAsCompatibility wiki page is a bit confusing, in that it provides a sample deployable WAR file that uses JBC 2.x, but without the relevant JAR files, and does not list which JAR files from the JBC distro should be included, and which are unnecessary.

              I'm trying to deploy an EAR containing JBC 2.2.0 within EAP 4.2, and when I include jboss-common-core.jar, I get ClassDefNotFoundErrors for ThreadPoolMBean, which is likely because jboss-common-core.jar eclipses some classes from JBossAS but not others, so the classloader gets into a spin.

              If I omit jboss-common-core.jar, then it instead it can't find MarshalledValueInputStream, which is present in JBossAS but in a different package.

              No combination of JARs from the 2.2.0, 2.1.0 or 2.0.0 distro seems to work in my EAP 4.2 when packed in an EAR.