5 Replies Latest reply on Sep 18, 2007 1:36 PM by Manik Surtani

    JBossCache 2.0 with JBoss AS 4.2.1 problems

    Navjeet Newbie

      Is it possible to use JBossCache with JBoss AS 4.2.1?

      As per JBoss Cache 2.0.0 docs somethings may not work as quoted below:

      It is possible to deploy a JBoss Cache 2.0 instance in JBoss AS 4.x (at least in 4.2.0.GA; other AS releases are completely untested). However, the significant API changes between the JBoss Cache 2.x and 1.x releases mean none of the standard AS 4.x clustering services (e.g. http session replication) that rely on JBoss Cache will work with JBoss Cache 2.x. Also, be aware that usage of JBoss Cache 2.x in AS 4.x is not something the JBoss Cache developers are making any significant effort to test, so be sure to test your application well (which of course you're doing anyway.)


      I downloaded JBossCache 2.0.0 GA, copied all the jars from lib folder to JBOSS_CONFIG/lib folder (I am using all configuration) and then copied replSync-service.xml from etc/META-INF to JBOSS_CONFIG/deploy folder and I get the following error during server startup:

      [java] --- MBeans waiting for other MBeans ---
      [java] ObjectName: jboss.cache:service=TreeCache
      [java] State: FAILED
      [java] Reason: org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute@ef5641 on mbean jboss.cache:service=TreeC
      ache; - nested throwable: (java.lang.VerifyError: (class: org/jboss/cache/config
      /Configuration, method: setCacheLoaderConfig signature: (Lorg/jboss/cache/config
      /CacheLoaderConfig;)V) Incompatible argument to function)
      [java] I Depend On:
      [java] jboss:service=Naming
      [java] jboss:service=TransactionManager

      [java] --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      [java] ObjectName: jboss.cache:service=TreeCache
      [java] State: FAILED
      [java] Reason: org.jboss.deployment.DeploymentException: Exception settin
      g attribute javax.management.Attribute@ef5641 on mbean jboss.cache:service=TreeC
      ache; - nested throwable: (java.lang.VerifyError: (class: org/jboss/cache/config
      /Configuration, method: setCacheLoaderConfig signature: (Lorg/jboss/cache/config
      /CacheLoaderConfig;)V) Incompatible argument to function)
      [java] I Depend On:
      [java] jboss:service=Naming
      [java] jboss:service=TransactionManager


      Did I miss any step or is this a compatibility issue?


        • 1. Re: JBossCache 2.0 with JBoss AS 4.2.1 problems
          Brian Stansberry Master

          Please post your config file (use the "Code" button). The etc/replSync-service.xml file does not include a cache loader.

          • 2. Re: JBossCache 2.0 with JBoss AS 4.2.1 problems
            Navjeet Newbie

            Now I am using local-eviction-cacheloader-service.xml from etc/META-INF but getting the same error.



            <?xml version="1.0" encoding="UTF-8"?>
            
            <!-- ===================================================================== -->
            <!-- -->
            <!-- Sample TreeCache Service Configuration -->
            <!-- -->
            <!-- ===================================================================== -->
            
            <server>
            
             <!-- ==================================================================== -->
             <!-- Defines TreeCache configuration -->
             <!-- ==================================================================== -->
            
             <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
             name="jboss.cache:service=TestTreeCache">
            
             <depends>jboss:service=Naming</depends>
             <depends>jboss:service=TransactionManager</depends>
            
             <!--
             Configure the TransactionManager
             -->
             <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
             </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
             -->
             <attribute name="CacheMode">LOCAL</attribute>
            
             <!-- Name of cluster. Needs to be the same for all clusters, in order
             to find each other
             -->
             <attribute name="ClusterName">JBossCache-Cluster</attribute>
            
             <!-- JGroups protocol stack properties NOT NEEDED since CacheMode is LOCAL -->
            
             <!--
             The max amount of time (in milliseconds) we wait until the
             state (ie. the contents of the cache) are retrieved from
             existing members in a clustered environment
             -->
             <attribute name="StateRetrievalTimeout">20000</attribute>
            
             <!--
             Number of milliseconds to wait until all responses for a
             synchronous call have been received.
             -->
             <attribute name="SyncReplTimeout">20000</attribute>
            
             <!-- Max number of milliseconds to wait for a lock acquisition -->
             <attribute name="LockAcquisitionTimeout">15000</attribute>
            
            
             <!-- Specific eviction policy configurations. This is LRU -->
             <attribute name="EvictionPolicyConfig">
             <config>
             <attribute name="wakeUpIntervalSeconds">5</attribute>
             <!-- Name of the DEFAULT eviction policy class. -->
             <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
            
             <!-- Cache wide default -->
             <region name="/_default_">
             <attribute name="maxNodes">5000</attribute>
             <attribute name="timeToLiveSeconds">1000</attribute>
             </region>
             <region name="/org/jboss/data">
             <attribute name="maxNodes">5000</attribute>
             <attribute name="timeToLiveSeconds">1000</attribute>
             </region>
             <region name="/org/jboss/test/data">
             <attribute name="maxNodes">5</attribute>
             <attribute name="timeToLiveSeconds">4</attribute>
             </region>
             <region name="/test">
             <attribute name="maxNodes">10000</attribute>
             <attribute name="timeToLiveSeconds">4</attribute>
             </region>
             <region name="/maxAgeTest">
             <attribute name="maxNodes">10000</attribute>
             <attribute name="timeToLiveSeconds">8</attribute>
             <attribute name="maxAgeSeconds">10</attribute>
             </region>
             </config>
             </attribute>
            
             <!-- New 1.3.x cache loader config block -->
             <attribute name="CacheLoaderConfig">
             <config>
             <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
             <passivation>false</passivation>
             <preload>/</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/JBossCacheFileCacheLoader
             </properties>
             <!-- whether the cache loader writes are asynchronous -->
             <async>false</async>
             <!-- 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>
             </cacheloader>
            
             </config>
             </attribute>
             </mbean>
            
            
            </server>
            


            • 3. Re: JBossCache 2.0 with JBoss AS 4.2.1 problems
              Brian Stansberry Master

              Earlier in the log there should be an ERROR logging and a stack trace from when this error actually happened. Please post it.

              • 4. Re: JBossCache 2.0 with JBoss AS 4.2.1 problems
                Navjeet Newbie

                 

                
                 [java] 13:19:35,691 INFO [ServiceConfigurator] Problem configuring service
                 jboss.cache:service=TestTreeCache
                 [java] org.jboss.deployment.DeploymentException: Exception setting attribut
                e javax.management.Attribute@1531aca on mbean jboss.cache:service=TestTreeCache;
                 - nested throwable: (java.lang.VerifyError: (class: org/jboss/cache/config/Conf
                iguration, method: setCacheLoaderConfig signature: (Lorg/jboss/cache/config/Cach
                eLoaderConfig;)V) Incompatible argument to function)
                 [java] at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConf
                igurator.java:698)
                 [java] at org.jboss.system.ServiceConfigurator.configure(ServiceConfigu
                rator.java:332)
                 [java] at org.jboss.system.ServiceConfigurator.internalInstall(ServiceC
                onfigurator.java:460)
                 [java] at org.jboss.system.ServiceConfigurator.install(ServiceConfigura
                tor.java:171)
                 [java] at org.jboss.system.ServiceController.install(ServiceController.
                java:226)
                 [java] at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
                 [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
                hodAccessorImpl.java:25)
                 [java] at java.lang.reflect.Method.invoke(Method.java:585)
                 [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
                Dispatcher.java:155)
                 [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                 [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
                Invoker.java:264)
                 [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
                va:659)
                 [java] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210
                )
                 [java] at $Proxy4.install(Unknown Source)
                 [java] at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
                
                 [java] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:96
                9)
                 [java] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:81
                8)
                 [java] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:78
                2)
                 [java] at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
                 [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
                hodAccessorImpl.java:25)
                 [java] at java.lang.reflect.Method.invoke(Method.java:585)
                 [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
                Dispatcher.java:155)
                 [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 [java] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractI
                nterceptor.java:133)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 [java] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invok
                e(ModelMBeanOperationInterceptor.java:142)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
                Invoker.java:264)
                 [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
                va:659)
                 [java] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210
                )
                 [java] at $Proxy10.deploy(Unknown Source)
                 [java] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLD
                eploymentScanner.java:421)
                 [java] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDep
                loymentScanner.java:634)
                 [java] at org.jboss.deployment.scanner.AbstractDeploymentScanner$Scanne
                rThread.doScan(AbstractDeploymentScanner.java:263)
                 [java] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startS
                ervice(AbstractDeploymentScanner.java:336)
                 [java] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(Servi
                ceMBeanSupport.java:289)
                 [java] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(S
                erviceMBeanSupport.java:245)
                 [java] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                 [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
                hodAccessorImpl.java:25)
                 [java] at java.lang.reflect.Method.invoke(Method.java:585)
                 [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
                Dispatcher.java:155)
                 [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                 [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
                Invoker.java:264)
                 [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
                va:659)
                 [java] at org.jboss.system.ServiceController$ServiceProxy.invoke(Servic
                eController.java:978)
                 [java] at $Proxy0.start(Unknown Source)
                 [java] at org.jboss.system.ServiceController.start(ServiceController.ja
                va:417)
                 [java] at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
                 [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
                hodAccessorImpl.java:25)
                 [java] at java.lang.reflect.Method.invoke(Method.java:585)
                 [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
                Dispatcher.java:155)
                 [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                 [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
                Invoker.java:264)
                 [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
                va:659)
                 [java] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210
                )
                 [java] at $Proxy4.start(Unknown Source)
                 [java] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                 [java] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:102
                5)
                 [java] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:81
                9)
                 [java] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:78
                2)
                 [java] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:76
                6)
                 [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
                sorImpl.java:39)
                 [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
                hodAccessorImpl.java:25)
                 [java] at java.lang.reflect.Method.invoke(Method.java:585)
                 [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
                Dispatcher.java:155)
                 [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 [java] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractI
                nterceptor.java:133)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 [java] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invok
                e(ModelMBeanOperationInterceptor.java:142)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
                Invoker.java:264)
                 [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
                va:659)
                 [java] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210
                )
                 [java] at $Proxy5.deploy(Unknown Source)
                 [java] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:48
                2)
                 [java] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                
                 [java] at org.jboss.Main.boot(Main.java:200)
                 [java] at org.jboss.Main$1.run(Main.java:508)
                 [java] at java.lang.Thread.run(Thread.java:595)
                 [java] Caused by: java.lang.VerifyError: (class: org/jboss/cache/config/Con
                figuration, method: setCacheLoaderConfig signature: (Lorg/jboss/cache/config/Cac
                heLoaderConfig;)V) Incompatible argument to function
                 [java] at org.jboss.cache.jmx.CacheJmxWrapper.getConfiguration(CacheJmx
                Wrapper.java:124)
                 [java] at org.jboss.cache.jmx.CacheJmxWrapper.setTransactionManagerLook
                upClass(CacheJmxWrapper.java:545)
                 [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
                sorImpl.java:39)
                 [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
                hodAccessorImpl.java:25)
                 [java] at java.lang.reflect.Method.invoke(Method.java:585)
                 [java] at org.jboss.mx.interceptor.AttributeDispatcher.invoke(Attribute
                Dispatcher.java:136)
                 [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                 [java] at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invok
                e(ModelMBeanAttributeInterceptor.java:103)
                 [java] at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(Persis
                tenceInterceptor.java:76)
                 [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 [java] at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(Abstrac
                tMBeanInvoker.java:461)
                 [java] at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerI
                mpl.java:608)
                 [java] at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConf
                igurator.java:694)
                 [java] ... 82 more
                


                • 5. Re: JBossCache 2.0 with JBoss AS 4.2.1 problems
                  Manik Surtani Master

                  You can't deploy a JBC 2.0.0 cache in JBoss AS as a JMX MBean the way you did with JBC 1.x. You will need to wait for AS 5 for this.

                  Until then you can instantiate and use JBC 2.0.0 programatically in your code.