10 Replies Latest reply on Feb 5, 2007 1:30 AM by bhavranjan

    Jboss Caching issue

    bhavranjan

      Hi All,

      I am using Jboss Cache
      i have configured the Configuration file as follows

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- Sample TreeCache Service Configuration -->
      <!-- -->
      <!-- ===================================================================== -->






      <!-- ==================================================================== -->
      <!-- Defines TreeCache configuration -->
      <!-- ==================================================================== -->



      jboss:service=Naming
      jboss:service=TransactionManager

      <!--
      Configure the TransactionManager
      -->
      org.jboss.cache.JBossTransactionManagerLookup

      <!--
      Node locking level : SERIALIZABLE
      REPEATABLE_READ (default)
      READ_COMMITTED
      READ_UNCOMMITTED
      NONE
      -->
      REPEATABLE_READ

      <!--
      Valid modes are LOCAL
      REPL_ASYNC
      REPL_SYNC
      INVALIDATION_ASYNC
      INVALIDATION_SYNC
      -->


      LOCAL

      <!-- New 1.3.x cache loader config block -->


      <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
      false
      /a/b, /allTempObjects, /some/specific/fqn,/demo
      false

      <!-- we can now have multiple cache loaders, which get chained -->

      org.jboss.cache.loader.FileCacheLoader
      <!-- same as the old CacheLoaderConfig attribute -->

      location=/tmp/bhavFileStore


      <!-- only one cache loader in the chain may set fetchPersistentState to true.
      An exception is thrown if more than one cache loader sets this to true. -->
      true
      <!-- determines whether this cache loader ignores writes - defaults to false. -->
      false
      <!-- if set to true, purges the contents of this cache loader when the cache starts up.
      Defaults to false. -->
      false







      <!--
      The max amount of time (in milliseconds) we wait until the
      initial state (ie. the contents of the cache) are retrieved from
      existing members in a clustered environment
      -->
      20000

      <!--
      Number of milliseconds to wait until all responses for a
      synchronous call have been received.
      -->
      15000

      <!-- Max number of milliseconds to wait for a lock acquisition -->
      10000


      <!-- Name of the eviction policy class. Not supported now. -->



      -------------------------------------------------------
      Configuration for binding with JNDI
      ------------------------------------------------------

      jboss:service=invoker,type=jrmp
      jboss.cache:service=TreeCache
      TreeCache true org.jboss.cache.TreeCacheMBean

      org.jboss.proxy.ClientMethodInterceptor
      org.jboss.proxy.SecurityInterceptor
      org.jboss.invocation.InvokerInterceptor

      jboss:service=invoker,type=jrmp
      jboss.cache:service=TreeCache




      I have two wars and no EAR. Second WAR is retrieving a string value stored in Cache by first WAR.

      But when i start the server it gives error:


      rg.jboss.deployment.DeploymentException: Class does not expose a management interface: java.lang.Object; - nested throwable: (javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
      at org.jboss.system.ServiceController.install(ServiceController.java:226)
      at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.install(Unknown Source)
      at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:490)
      at java.lang.Thread.run(Unknown Source)


      and


      --- Incompletely deployed packages ---
      org.jboss.deployment.DeploymentInfo@d562c17c { url=file:/D:/jboss-4.0.5.GA/server/default/deploy/tree-service.xml }
      deployer: org.jboss.deployment.SARDeployer@5a67c9
      status: Deployment FAILED reason: Class does not expose a management interface: java.lang.Object; - nested throwable: (javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object)
      state: FAILED
      watch: file:/D:/jboss-4.0.5.GA/server/default/deploy/tree-service.xml
      altDD: null
      lastDeployed: 1170235288122
      lastModified: 1170235288107
      mbeans:

        • 1. Re: Jboss Caching issue
          genman

          It's trying to deploy an MBean in tree-service.xml that appears to be a java.lang.Object. Did you change this file or where did you get it?

          • 2. Re: Jboss Caching issue
            bhavranjan

            Thanks for ur reply Genman

            I have put the tree-service.xml in /deploy dir of ALL configuration now its

            gives a new error

            Error creating MBeanProxy: jboss.cache:service=TreeCache
            at org.jboss.mx.util.MBeanProxyExt.init(MBeanProxyExt.java:415)
            at org.jboss.mx.util.MBeanProxyExt.(MBeanProxyExt.java:99)
            at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:394)
            at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:349)
            at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:324)
            at com.niit.assedere.init.core.HelloWorldWeb2Servlet.service(HelloWorldWeb2Servlet.java:40)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Unknown Source)
            Caused by: javax.management.InstanceNotFoundException:

            jboss.cache:service=TreeCache is not registered.

            at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:523)
            at org.jboss.mx.server.MBeanServerImpl.getMBeanInfo(MBeanServerImpl.java:666)
            at org.jboss.mx.util.MBeanProxyExt.init(MBeanProxyExt.java:407)


            it says that TreeCache is not registered

            What could be possible error?

            Any help would be appreciated

            • 3. Re: Jboss Caching issue
              bhavranjan

              I got one solution as TreeCache is not registered in jboss.cache so its

              not possible to access this . here is fine


              Now i am trying to register TreeCache Mbean by these steps

              I copied jboss-cache.jar and jgroups.jar in ${jboss.home}/lib dir

              and copied the tree-service.xml in ${jboss.home}/server/all/deploy dir

              but i am not able to register the Mbean


              this is my tree-service.xml file

              <?xml version="1.0" encoding="UTF-8"?>

              <!-- ===================================================================== -->
              <!-- -->
              <!-- Sample TreeCache Service Configuration -->
              <!-- -->
              <!-- ===================================================================== -->






              <!-- ==================================================================== -->
              <!-- Defines TreeCache configuration -->
              <!-- ==================================================================== -->



              jboss:service=Naming
              jboss:service=TransactionManager

              <!--
              Configure the TransactionManager
              -->
              org.jboss.cache.JBossTransactionManagerLookup

              <!--
              Node locking level : SERIALIZABLE
              REPEATABLE_READ (default)
              READ_COMMITTED
              READ_UNCOMMITTED
              NONE
              -->
              REPEATABLE_READ

              <!--
              Valid modes are LOCAL
              REPL_ASYNC
              REPL_SYNC
              INVALIDATION_ASYNC
              INVALIDATION_SYNC
              -->


              LOCAL

              <!-- New 1.3.x cache loader config block -->


              <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
              false
              /demo
              false

              <!-- we can now have multiple cache loaders, which get chained -->

              org.jboss.cache.loader.FileCacheLoader
              <!-- same as the old CacheLoaderConfig attribute -->

              location=/tmp/bhavFileStore


              <!-- only one cache loader in the chain may set fetchPersistentState to true.
              An exception is thrown if more than one cache loader sets this to true. -->
              true
              <!-- determines whether this cache loader ignores writes - defaults to false. -->
              false
              <!-- if set to true, purges the contents of this cache loader when the cache starts up.
              Defaults to false. -->
              false







              <!--
              The max amount of time (in milliseconds) we wait until the
              initial state (ie. the contents of the cache) are retrieved from
              existing members in a clustered environment
              -->
              20000

              <!--
              Number of milliseconds to wait until all responses for a
              synchronous call have been received.
              -->
              15000

              <!-- Max number of milliseconds to wait for a lock acquisition -->
              10000


              <!-- Name of the eviction policy class. Not supported now. -->




              jboss:service=invoker,type=jrmp
              jboss.cache:service=TreeCache
              TreeCache true org.jboss.cache.TreeCacheMBean

              org.jboss.proxy.ClientMethodInterceptor
              org.jboss.proxy.SecurityInterceptor
              org.jboss.invocation.InvokerInterceptor

              jboss:service=invoker,type=jrmp
              jboss.cache:service=TreeCache



              should i put this file in default/deploy dir


              any help would be appreciated



              • 4. Re: Jboss Caching issue
                manik

                what version of jboss cache are you using?

                • 5. Re: Jboss Caching issue
                  bhavranjan

                  Thanks for ur reply

                  I m using version 1.4.0 SP1

                  • 6. Re: Jboss Caching issue
                    bhavranjan

                    Is it the issue of JBoss As version ? As i m using Jboss 4.0.5 GA

                    • 7. Re: Jboss Caching issue
                      manik

                      No, I just asked because the MBean name is different in 2.0.0.

                      Please use the CODE button when posting XML code, otherwise elements get lost and cannot be read.

                      • 8. Re: Jboss Caching issue
                        bhavranjan

                        I gone through the JBoss 4.0.5 GA server . For caching it requires jboss-cache.jar 1.4.1 .That is still in QA . So Ithink its the issue of version compatiblity

                        • 9. Re: Jboss Caching issue
                          brian.stansberry

                          AS 4.0.5 does not require 1.4.1; it ships with 1.4.0.SP1.

                          As Manik said, use the CODE button when posting XML.

                          From the garbled post I'm *guessing* that your problem is you are using org.jboss.cache.TreeCacheMBean as the value of the "code" attribute of the "mbean" element. If so, that's incorrect. You should use org.jboss.cache.TreeCache.

                          For example:

                          <?xml version="1.0" encoding="UTF-8"?>
                          <server>
                           <mbean code="org.jboss.cache.TreeCache"
                           name="jboss.cache:service=TreeCache">
                          
                          ...
                          


                          • 10. Re: Jboss Caching issue
                            bhavranjan

                             

                             Thanks for ur reply
                            
                            I have already checked that , here is my confi.xml files
                            
                            <?xml version="1.0" encoding="UTF-8"?>
                            
                            <!-- ===================================================================== -->
                            <!-- -->
                            <!-- Sample TreeCache Service Configuration -->
                            <!-- -->
                            <!-- ===================================================================== -->
                            
                            <server>
                            
                             <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
                            
                            
                             <!-- ==================================================================== -->
                             <!-- Defines TreeCache configuration -->
                             <!-- ==================================================================== -->
                            
                             <mbean code="org.jboss.cache.TreeCache"
                             name="jboss.cache:service=TreeCache">
                            
                             <depends>jboss:service=Naming</depends>
                             <depends>jboss:service=TransactionManager</depends>
                            
                             <!--
                             Configure the TransactionManager
                             -->
                             <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
                            
                             <!--
                             Node locking level : SERIALIZABLE
                             REPEATABLE_READ (default)
                             READ_COMMITTED
                             READ_UNCOMMITTED
                             NONE
                             -->
                             <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
                            
                             <!--
                             Valid modes are LOCAL
                             REPL_ASYNC
                             REPL_SYNC
                             INVALIDATION_ASYNC
                             INVALIDATION_SYNC
                             -->
                            
                            
                             <attribute name="CacheMode">LOCAL</attribute>
                            
                             <!-- New 1.3.x cache loader config block -->
                             <attribute name="CacheLoaderConfiguration">
                             <config>
                             <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
                             <passivation>false</passivation>
                             <preload>/demo</preload>
                             <shared>false</shared>
                            
                             <!-- we can now have multiple cache loaders, which get chained -->
                             <cacheloader>
                             <class>org.jboss.cache.loader.FileCacheLoader</class>
                             <!-- same as the old CacheLoaderConfig attribute -->
                             <properties>
                             location=/tmp/bhavFileStore
                             </properties>
                            
                             <!-- only one cache loader in the chain may set fetchPersistentState to true.
                             An exception is thrown if more than one cache loader sets this to true. -->
                             <fetchPersistentState>true</fetchPersistentState>
                             <!-- determines whether this cache loader ignores writes - defaults to false. -->
                             <ignoreModifications>false</ignoreModifications>
                             <!-- if set to true, purges the contents of this cache loader when the cache starts up.
                             Defaults to false. -->
                             <purgeOnStartup>false</purgeOnStartup>
                             </cacheloader>
                            
                            
                            
                             </config>
                            
                             </attribute>
                             <!--
                             The max amount of time (in milliseconds) we wait until the
                             initial state (ie. the contents of the cache) are retrieved from
                             existing members in a clustered environment
                             -->
                             <attribute name="InitialStateRetrievalTimeout">20000</attribute>
                            
                             <!--
                             Number of milliseconds to wait until all responses for a
                             synchronous call have been received.
                             -->
                             <attribute name="SyncReplTimeout">15000</attribute>
                            
                             <!-- Max number of milliseconds to wait for a lock acquisition -->
                             <attribute name="LockAcquisitionTimeout">10000</attribute>
                            
                            
                             <!-- Name of the eviction policy class. Not supported now. -->
                             <attribute name="EvictionPolicyClass"></attribute>
                             </mbean>
                            
                            <mbean
                            code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
                            name="jboss:service=proxyFactory,type=jrmp,target=factory">
                            <attribute
                            name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
                            <attribute
                            name="TargetName">jboss.cache:service=TreeCache</attribute>
                            <attribute name="JndiName">TreeCache</attribute> <attribute
                            name="InvokeTargetMethod">true</attribute> <attribute
                            name="ExportedInterface">org.jboss.cache.TreeCacheMBean</attribute>
                            <attribute name="ClientInterceptors"> <iterceptors>
                            <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
                            <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
                            <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
                            </iterceptors> </attribute>
                            <depends>jboss:service=invoker,type=jrmp</depends>
                            <depends>jboss.cache:service=TreeCache</depends>
                            </mbean>
                            </server>