2 Replies Latest reply on Jul 3, 2007 2:11 PM by madhavsapre

    Error while accessing cache through wrapper

    madhavsapre

      Hi,
      I have configured JBoss Cache 2.0 to run as MBean in JBoss AS 4.05 as follows in the jboss-service.xml

      mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper" name="jboss.cache:service=POJOCache"


      In my code, I try to get reference to the POJOCache as follows.

      server = MBeanServerLocator.locateJBoss();
      cacheWrapper = (org.jboss.cache.jmx.CacheJmxWrapperMBean) MBeanProxyExt.create(CacheJmxWrapperMBean.class, "jboss.cache:service=POJOCache", server);

      CacheStatus status = cacheWrapper.getCacheStatus();
      System.out.println("Cache Status is " + status);
      cache = (PojoCache)cacheWrapper.getCache();


      I see from the log that MBean gets deployed without any exception. Also, the CacheStatus is shown as STARTED. But when getCache() method is called on the cacheWrapper, I get following exception

      Exception occurred during cache initialization Unable to find operation getCache()
      2007-07-03 13:04:31,765 ERROR [RMI TCP Connection(2)-172.26.41.141]
      [STDERR] LoggerStream.java:write():152 java.lang.IllegalArgumentException: Unable to find
      operation getCache()
      2007-07-03 13:04:31,812 ERROR [RMI TCP Connection(2)-172.26.41.141] [STDERR]
      LoggerStream.java:write():152 at org.jboss.mx.server.AbstractMBeanInvoker.invo
      ke(AbstractMBeanInvoker.java:231)


      Can anybody help me understand why I'm getting this exception? I checked API documentation @ http://labs.jboss.com/file-access/default/members/jbosscache/freezone/docs/2.0.0.CR2/api/index.html

      and found the operation defined on the CacheJmxWrapperMBean interface.