1 Reply Latest reply on Jan 12, 2010 12:10 PM by Brian Stansberry

    Cache not in STARTED state

    nandan jain Newbie

      Hi all,

      I am facing an issue when running Jboss in Clustered mode.

      When ever i stop Jboss i am getting an exception given below.

       

      2010-01-12 12:57:07,093 WARN  [org.jboss.kernel.plugins.dependency.StartStopLifecycleAction] (JBoss Shutdown Hook) Error during stop for persistence.unit:unitName=DXDServer.ear/DXDCore.jar#dxd
      org.hibernate.cache.CacheException: java.lang.IllegalStateException: Cache not in STARTED state!
              at org.hibernate.cache.jbc.BasicRegionAdapter.destroy(BasicRegionAdapter.java:330)
              at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:813)
              at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
              at org.jboss.jpa.deployment.ManagedEntityManagerFactory.destroy(ManagedEntityManagerFactory.java:93)
              at org.jboss.jpa.deployment.PersistenceUnitDeployment.stop(PersistenceUnitDeployment.java:333)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
              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.LifecycleAction.uninstallActionInternal(LifecycleAction.java:249)
              at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:157)
              at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:42)
              at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleUninstallAction(SimpleControllerContextAction.java:79)
              at org.jboss.dependency.plugins.action.AccessControllerContextAction.uninstall(AccessControllerContextAction.java:131)
              at org.jboss.dependency.plugins.AbstractControllerContextActions.uninstall(AbstractControllerContextActions.java:58)
              at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
              at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
              at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
              at org.jboss.system.ServiceController.stop(ServiceController.java:510)
              at org.jboss.system.microcontainer.jmx.ServiceControllerStartStopLifecycleCallback.uninstall(ServiceControllerStartStopLifecycleCallback.java:52)
              at sun.reflect.GeneratedMethodAccessor491.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
              at org.jboss.beans.info.plugins.AbstractBeanInfo.invoke(AbstractBeanInfo.java:300)
              at org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext.invoke(AbstractKernelControllerContext.java:286)
              at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.uninstall(AbstractLifecycleCallbackItem.java:112)
              at org.jboss.dependency.plugins.AbstractController.handleLifecycleCallbacks(AbstractController.java:1570)
              at org.jboss.dependency.plugins.AbstractController.handleUninstallLifecycleCallbacks(AbstractController.java:1546)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1273)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
              at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:655)
              at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:568)
              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:153)
              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:51)
              at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalUndeploy(AbstractSimpleRealDeployer.java:69)
              at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.undeploy(AbstractRealDeployer.java:112)
              at org.jboss.deployers.plugins.deployers.DeployerWrapper.undeploy(DeployerWrapper.java:196)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doUndeploy(DeployersImpl.java:1469)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1376)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1369)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.uninstall(DeployersImpl.java:1331)
              at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
              at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:694)
              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
              at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
              at org.jboss.system.server.profileservice.repository.ProfileDeployAction.uninstall(ProfileDeployAction.java:95)
              at org.jboss.system.server.profileservice.repository.AbstractProfileAction.uninstall(AbstractProfileAction.java:70)
              at org.jboss.system.server.profileservice.repository.AbstractProfileService.uninstall(AbstractProfileService.java:375)
              at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
              at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
              at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
              at org.jboss.system.server.profileservice.repository.AbstractProfileService.deactivateProfile(AbstractProfileService.java:402)
              at org.jboss.system.server.profileservice.ProfileServiceBootstrap.deactivateProfiles(ProfileServiceBootstrap.java:388)
              at org.jboss.system.server.profileservice.ProfileServiceBootstrap.shutdown(ProfileServiceBootstrap.java:345)
              at org.jboss.bootstrap.AbstractServerImpl.shutdownServer(AbstractServerImpl.java:571)
              at org.jboss.bootstrap.AbstractServerImpl$ShutdownHook.run(AbstractServerImpl.java:909)
      Caused by: java.lang.IllegalStateException: Cache not in STARTED state!
              at org.jboss.cache.invocation.CacheInvocationDelegate.cacheStatusCheck(CacheInvocationDelegate.java:695)
              at org.jboss.cache.invocation.CacheInvocationDelegate.removeNode(CacheInvocationDelegate.java:475)
              at org.jboss.ha.cachemanager.CacheManagerManagedCache.removeNode(CacheManagerManagedCache.java:317)
              at org.hibernate.cache.jbc.BasicRegionAdapter.destroy(BasicRegionAdapter.java:327)
              ... 82 more

       

       

       

      Settings in Persistence.xml are given below..

       

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
                   version="1.0">
         <persistence-unit name="dxd">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:/mysqlds</jta-data-source>
              <properties>
                  <property name="hibernate.hbm2ddl.auto" value="update" />
                  <property name="hibernate.show_sql" value="false" /> 
                  <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>     
                  <property name="hibernate.cache.use_second_level_cache"  value="true" />            
                <property name="hibernate.cache.region.factory_class"
                      value="org.hibernate.cache.jbc2.JndiMultiplexedJBossCacheRegionFactory" />
                  <property name="hibernate.transaction.manager_lookup_class"
                      value="org.hibernate.transaction.JBossTransactionManagerLookup" />
                  <!-- region factory specific properties -->
                  <property name="hibernate.cache.region.jbc2.cachefactory"
                      value="java:CacheManager" />
                  <property name="hibernate.cache.region.jbc2.cfg.entity"
                      value="mvcc-entity" />
                  <property name="hibernate.cache.region.jbc2.cfg.collection"
                      value="mvcc-entity" />
                  <property name="hibernate.connection.release_mode" value="auto" />
              </properties>
         
         </persistence-unit>
      </persistence>
      
      
      I am using @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL) on my Entity classes.
      
      Can anyone help me regarding this problem. I tried to google but did not get any proper answer.
      
      
      Thanks in advance...!!!