10 Replies Latest reply on Feb 16, 2004 12:32 PM by traxx

    Entity cache invalidation

    traxx Newbie

      Hi,

      I try to use cache invalidation but when I add
      <configuration-name>Standard CMP 2.x EntityBean with cache invalidation</configuration-name>
      <cache-invalidation>True</cache-invalidation>

      The entity is not deployed :
      17:58:26,819 WARN (main) [ServiceController] Problem starting service jboss.j2ee:jndiName=Client,service=EJB
      java.lang.NoSuchMethodError: org.jboss.system.ServiceMBeanSupport.access$001(Lorg/jboss/cache/invalidation/InvalidationManager;)Lorg/jboss/logging/Logger;
      at org.jboss.cache.invalidation.InvalidationManager$InvalidationGroupImpl.addReference(InvalidationManager.java:387)
      at org.jboss.cache.invalidation.InvalidationManager.getInvalidationGroup(InvalidationManager.java:89)
      at org.jboss.ejb.plugins.InvalidableEntityInstanceCache.start(InvalidableEntityInstanceCache.java:107)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:336)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
      at $Proxy11.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy24.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:347)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
      at $Proxy11.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy21.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:541)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:280)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:273)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:242)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:597)
      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:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:361)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:268)
      at org.jboss.Main.boot(Main.java:156)
      at org.jboss.Main$1.run(Main.java:394)
      at java.lang.Thread.run(Thread.java:536)


      Any idea ? thanks !

        • 1. Re: Entity cache invalidation
          traxx Newbie

          Ok, now I use JBoss 3.2.3 (3.2.1 previously). No more problem with deployment but when I try to use a CMR :
          15:04:37,005 ERROR [LogInterceptor] RuntimeException:
          java.lang.NullPointerException
          at org.jboss.cache.invalidation.InvalidationsTxGrouper.registerInvalidationSynchronization(InvalidationsTxGrouper.java:76)
          at org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor.invoke(EntityBeanCacheBatchInvalidatorInterceptor.java:106)
          at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:337)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
          at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:71)
          at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:163)
          at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
          at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54)
          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:297)
          at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
          at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
          at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:489)
          at org.jboss.ejb.Container.invoke(Container.java:700)
          at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
          at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
          at $Proxy146.getLinkedSimplePopup(Unknown Source)
          at clicktocontact.application.webEnv.ButtonBean.retrieveView(ButtonBean.java:84)

          Any idea ? thanks !

          • 2. Re: Entity cache invalidation
            Andrew Oliver Master

            what is your transaction setting?

            • 3. Re: Entity cache invalidation
              traxx Newbie

              The retrieveView method transaction attribute is 'supports'. My application runs without cache invalidation. I would like to test performances with cache invalidation, I have to change something about transactions to use this new feature ?
              Thanks !

              My deployment descriptor :
              [...]
              <container-transaction>


              <ejb-name>Button</ejb-name>
              <method-name>*</method-name>

              <trans-attribute>Required</trans-attribute>
              </container-transaction>
              <container-transaction>


              <ejb-name>Button</ejb-name>
              <method-name>getBody</method-name>



              <ejb-name>Button</ejb-name>
              <method-name>getId</method-name>



              <ejb-name>Button</ejb-name>
              <method-name>getName</method-name>



              <ejb-name>Button</ejb-name>
              <method-name>getPublishedButton</method-name>



              <ejb-name>Button</ejb-name>
              <method-name>retrieveComponentViewId</method-name>



              <ejb-name>Button</ejb-name>
              <method-name>retrieveMiniView</method-name>



              <ejb-name>Button</ejb-name>
              <method-name>retrieveView</method-name>

              <trans-attribute>Supports</trans-attribute>
              </container-transaction>
              [...]

              • 4. Re: Entity cache invalidation
                Andrew Oliver Master

                You need a transaction. Required, RequiresNew, Mandatory.

                • 5. Re: Entity cache invalidation
                  traxx Newbie

                  Ok, thanks, so everything need to be in a transaction ?
                  I saw nothing about that in the documentation ?

                  • 6. Re: Entity cache invalidation
                    Sacha Labourey Master

                    Yes, it needs to be: there is already a bug report on sf.net about it.

                    Cheers,

                    sacha

                    • 8. Re: Entity cache invalidation
                      Andrew Oliver Master

                      I believe the documentation says JBossCMP requires a transaction.

                      • 9. Re: Entity cache invalidation
                        traxx Newbie

                        Really ? My application runs since 1 year with and without transactions. It's composed of 60 CMP entities.

                        • 10. Re: Entity cache invalidation
                          traxx Newbie

                          Sometimes, I don't want to lock the entity so I put a 'supports' attribute and my application is more efficient.