1 Reply Latest reply on Jun 28, 2004 4:41 PM by Marcelo Pitanga

    Install Container Interceptor

    Marcelo Pitanga Newbie

      Hi all,

      anyone can help me?

      I created a plugin interceptor for monitoring my EJB...

      I update the file standardjboss.xml :

      <container-configuration>
      <container-name>Standard CMP 2.x EntityBean</container-name>
      <call-logging>false</call-logging>
      <invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name>
      <sync-on-commit-only>false</sync-on-commit-only>
      <insert-after-ejb-post-create>false</insert-after-ejb-post-create>
      <call-ejb-store-on-clean>true</call-ejb-store-on-clean>
      <container-interceptors>
      org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor
      org.jboss.ejb.plugins.LogInterceptor
      org.jboss.ejb.plugins.SecurityInterceptor
      org.jboss.ejb.plugins.TxInterceptorCMT
      org.jboss.ejb.plugins.CallValidationInterceptor
      org.jboss.ejb.plugins.MetricsInterceptor
      org.jboss.ejb.plugins.EntityCreationInterceptor
      org.jboss.ejb.plugins.EntityLockInterceptor
      org.jboss.ejb.plugins.EntityInstanceInterceptor
      org.jboss.ejb.plugins.EntityReentranceInterceptor
      org.jboss.resource.connectionmanager.CachedConnectionInterceptor
      org.jboss.ejb.plugins.EntitySynchronizationInterceptor
      org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor

      <!-- MY INTERCEPTOR -->
      middllog.interceptor.EJBInterceptor

      </container-interceptors>
      <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
      <instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</instance-cache>
      <persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager>
      <locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
      <container-cache-conf>
      <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
      <cache-policy-conf>
      <min-capacity>50</min-capacity>
      <max-capacity>1000000</max-capacity>
      <overager-period>300</overager-period>
      <max-bean-age>600</max-bean-age>
      <resizer-period>400</resizer-period>
      <max-cache-miss-period>60</max-cache-miss-period>
      <min-cache-miss-period>1</min-cache-miss-period>
      <cache-load-factor>0.75</cache-load-factor>
      </cache-policy-conf>
      </container-cache-conf>
      <container-pool-conf>
      100
      </container-pool-conf>
      <commit-option>B</commit-option>
      </container-configuration>

      When i started the Jboss ( version 4.0DR4 ) this error

      13:45:43,812 INFO [EjbModule] Deploying MEJB
      13:46:05,796 WARN [EjbModule] Could not load the middllog.interceptor.EJBInterceptor interceptor for this container
      java.lang.ClassNotFoundException: No ClassLoaders found for: middllog.interceptor.EJBInterceptor
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:174)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
      assLoader.java:466)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
      oader.java:377)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      .....

      and when go make deploying of the HelloWorld.jar occurs this error:

      13:45:43,406 INFO [EJBDeployer] Deployed: file:/D:/jboss-4.0.0DR4/server/defaul
      t/deploy/HelloWorld/HelloWorld.jar
      13:45:43,812 INFO [EjbModule] Deploying MEJB
      13:46:05,796 WARN [EjbModule] Could not load the middllog.interceptor.EJBInterc
      eptor interceptor for this container
      java.lang.ClassNotFoundException: No ClassLoaders found for: middllog.intercepto
      r.EJBInterceptor
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:174)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
      assLoader.java:466)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
      oader.java:377)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at org.jboss.util.loading.DelegatingClassLoader.loadClass(DelegatingClas
      sLoader.java:77)
      at org.jboss.mx.loading.LoaderRepositoryClassLoader.loadClass(LoaderRepo
      sitoryClassLoader.java:78)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at org.jboss.util.loading.DelegatingClassLoader.loadClass(DelegatingClas
      sLoader.java:77)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at org.jboss.ejb.EjbModule.addInterceptors(EjbModule.java:844)
      at org.jboss.ejb.EjbModule.initializeContainer(EjbModule.java:731)
      at org.jboss.ejb.EjbModule.createStatelessSessionContainer(EjbModule.jav
      a:535)
      at org.jboss.ejb.EjbModule.createContainer(EjbModule.java:490)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:288)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBean
      Support.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
      eanSupport.java:219)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:232)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:643)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:844)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:285)

      at org.jboss.system.ServiceController.create(ServiceController.java:218)

      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:232)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:643)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
      at $Proxy15.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:548)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:817)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:673)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:637)
      at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:232)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:643)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:478)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
      bstractDeploymentScanner.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
      upport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
      eanSupport.java:221)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:232)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:643)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:844)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:369)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:232)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:643)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:260)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:863)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:674)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:637)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:232)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:643)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:386)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
      at org.jboss.Main.boot(Main.java:150)
      at org.jboss.Main$1.run(Main.java:395)
      at java.lang.Thread.run(Thread.java:534)


      and when i execute a EJB HelloWorld, my interceptor don´t execute.



      This interceptor goes created inside of EJB-JAR...and when i deploying this JAR first, my interceptor works fine...