2 Replies Latest reply on Jan 22, 2009 4:11 PM by Andres Vergara

    Cannot deploy PojoCache 3.0.0.GA in JBoss 5.0.0.GA

    Andres Vergara Newbie

      I am trying to deploy a PojoCache 3.0.0.GA in JBoss 5.0.0.GA, but keep getting the exception:
      java.lang.IllegalArgumentException: Wrong arguments. createCache for target null expected=[java.lang.String, boolean] actual=[org.jboss.cache.config.Configuration, java.lang.Boolean]

      Here is my cache-beans.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
      
      
      <deployment xmlns="urn:jboss:bean-deployer:2.0">
      
      
      
       <!-- First we create a Configuration object for the cache -->
       <bean name="MagnitudeCacheConfig" class="org.jboss.cache.config.Configuration">
      
       <!-- Provides batching functionality for caches that don't want to interact with regular JTA Transactions -->
       <property name="transactionManagerLookupClass">org.jboss.cache.transaction.BatchModeTransactionManagerLookup</property>
      
       <!-- Name of cluster. Needs to be the same for all members -->
       <property name="clusterName">${jboss.partition.name:DefaultPartition}-MagnitudeClusterCache</property>
       <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
       because we are using asynchronous replication. -->
       <property name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
       <property name="fetchInMemoryState">true</property>
      
       <property name="nodeLockingScheme">PESSIMISTIC</property>
       <property name="isolationLevel">REPEATABLE_READ</property>
       <property name="cacheMode">REPL_ASYNC</property>
      
       <property name="syncReplTimeout">17500</property>
       <property name="lockAcquisitionTimeout">15000</property>
       <property name="stateRetrievalTimeout">60000</property>
      
       <!-- Field granularity requires region-based marshalling -->
       <property name="useRegionBasedMarshalling">true</property>
       <!-- Must match the value of "useRegionBasedMarshalling" -->
       <property name="inactiveOnStartup">true</property>
      
       <!-- Disable asynchronous RPC marshalling/sending -->
       <property name="serializationExecutorPoolSize">0</property>
       <!-- We have no asynchronous notification listeners -->
       <property name="listenerAsyncPoolSize">0</property>
      
       <property name="exposeManagementStatistics">true</property>
      
       <property name="buddyReplicationConfig">
       <bean class="org.jboss.cache.config.BuddyReplicationConfig">
      
       <!-- Just set to true to turn on buddy replication -->
       <property name="enabled">false</property>
       <!-- A way to specify a preferred replication group. We try
       and pick a buddy who shares the same pool name (falling
       back to other buddies if not available). -->
       <property name="buddyPoolName">default</property>
       <property name="buddyCommunicationTimeout">17500</property>
      
       <!-- Do not change these -->
       <property name="autoDataGravitation">false</property>
       <property name="dataGravitationRemoveOnFind">true</property>
       <property name="dataGravitationSearchBackupTrees">true</property>
      
       <property name="buddyLocatorConfig">
       <bean class="org.jboss.cache.buddyreplication.NextMemberBuddyLocatorConfig">
       <!-- The number of backup nodes we maintain -->
       <property name="numBuddies">1</property>
       <!-- Means that each node will *try* to select a buddy on
       a different physical host. If not able to do so
       though, it will fall back to colocated nodes. -->
       <property name="ignoreColocatedBuddies">true</property>
       </bean>
       </property>
       </bean>
       </property>
       <property name="cacheLoaderConfig">
       <bean class="org.jboss.cache.config.CacheLoaderConfig">
       <!-- Do not change these -->
       <property name="passivation">true</property>
       <property name="shared">false</property>
      
       <property name="individualCacheLoaderConfigs">
       <list>
       <bean class="org.jboss.cache.loader.FileCacheLoaderConfig">
       <!-- Where passivated sessions are stored -->
       <property name="location">${jboss.server.data.dir}${/}magnitude-cluster-cache</property>
       <!-- Do not change these -->
       <property name="async">false</property>
       <property name="fetchPersistentState">true</property>
       <property name="purgeOnStartup">true</property>
       <property name="ignoreModifications">false</property>
       <property name="checkCharacterPortability">false</property>
       </bean>
       </list>
       </property>
       </bean>
       </property>
      
       </bean>
      
      
       <!-- The cache itself. -->
       <bean name="MagnitudeClusterCache" class="org.jboss.cache.pojo.impl.PojoCacheImpl">
      
       <constructor factoryClass="org.jboss.cache.pojo.PojoCacheFactory" factoryMethod="createCache">
       <parameter><inject bean="MagnitudeCacheConfig"/></parameter>
       <parameter>false</parameter>
       </constructor>
      
       </bean>
      
       <!-- JMX Management -->
       <bean name="MagnitudeClusterCacheJmxWrapper" class="org.jboss.cache.jmx.CacheJmxWrapper">
      
       <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=MagnitudeClusterCache",exposedInterface=org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean.class,registerDirectly=true)</annotation>
      
       <constructor>
       <parameter><inject bean="MagnitudeClusterCache"/></parameter>
       </constructor>
      
       </bean>
      
      
      
      </deployment>
      


      Here is the exception I am getting by JBoss:
      08:56:11,671 ERROR [AbstractKernelController] Error installing to Instantiated: name=MagnitudeClusterCache state=Described
      java.lang.IllegalArgumentException: Wrong arguments. createCache for target null expected=[java.lang.String, boolean] actual=[org.jboss.cache.config.Configuration, java.lang.Boolean]
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:69)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
       at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:66)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       at java.lang.Thread.run(Thread.java:637)
      08:56:11,673 INFO [STDOUT] 08:56:11 [AbstractController] ERROR: Error installing to Instantiated: name=MagnitudeClusterCache state=Described
      java.lang.IllegalArgumentException: Wrong arguments. createCache for target null expected=[java.lang.String, boolean] actual=[org.jboss.cache.config.Configuration, java.lang.Boolean]
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:69)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
       at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:66)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       at java.lang.Thread.run(Thread.java:637)
      08:56:11,697 WARN [HDScanner] Failed to process changes
      
      
      
      


      Don't understand why the wrong argument for the constructor as it takes either a String or a Configuration object. Any ideas?

      Thanks.


        • 2. Re: Cannot deploy PojoCache 3.0.0.GA in JBoss 5.0.0.GA
          Andres Vergara Newbie

          Thanks to FrankTheTank's reply and after looking at the given post I was able to figure out the problem. The issue was in some missing things in the xml and a wrong class for the JMXWrapper:

          In the following snippet I added 'class="org.jboss.cache.config.Configuration"' and 'class="boolean"' to the 'parameter' definition, that made JBoss to pick the right constructor on deployment and got rid of the "java.lang.IllegalArgumentException: Wrong arguments." error.

          
           <!-- The cache itself. -->
           <bean name="MagnitudeClusterCache" class="org.jboss.cache.pojo.impl.PojoCacheImpl">
          
           <constructor factoryClass="org.jboss.cache.pojo.PojoCacheFactory" factoryMethod="createCache">
           <parameter class="org.jboss.cache.config.Configuration"><inject bean="MagnitudeCacheConfig"/></parameter>
           <parameter class="boolean">false</parameter>
           </constructor>
          
           </bean>
          



          One more thing that I corrected was the class for the JMXWrapper; I replaced '"org.jboss.cache.jmx.CacheJmxWrapper' which is used for the plain cache for 'org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper' which is the correct JMXWrapper class for the POJOCache:

           <!-- JMX Management -->
           <bean name="MagnitudeClusterCacheJmxWrapper" class="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper">
          
           <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=MagnitudeClusterCache",exposedInterface=org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean.class,registerDirectly=true)</annotation>
          
           <constructor>
           <parameter><inject bean="MagnitudeClusterCache"/></parameter>
           </constructor>
          
           </bean>



          Hope this helps somebody else with the same issues.

          Andres.