0 Replies Latest reply on Jun 15, 2003 5:10 AM by Eyal

    adding a new interceptor

    Eyal Newbie

      I'm trying to add a new interceptor to jBoss 3.0
      In standardjboss.xml I've added the declaration of the new interceptor:

      ....
      <container-configuration>
      <container-name>Standard Stateless SessionBean</container-name>
      <call-logging>false</call-logging>
      <container-invoker>org.jboss.proxy.ejb.ProxyFactory</container-invoker>
      <container-interceptors>
      org.jboss.ejb.plugins.LogInterceptor
      org.jboss.ejb.plugins.SecurityInterceptor
      com.company.ejb.jboss.CompanyInterceptor
      <!-- CMT -->
      ....
      my interceptor looks like this:

      package com.company.ejb.jboss;

      import com.company.exceptions.BusinessException;
      import org.jboss.invocation.Invocation;
      import org.jboss.proxy.Interceptor;


      public class CompanyInterceptor extends Interceptor {

      public Object invoke(final Invocation mi) throws Throwable {
      try {
      // Invoke through interceptors
      System.out.println("@@@@@@@@@@ Invoke through interceptor");
      return getNext().invoke(mi);
      } catch (BusinessException e) {
      mi.getTransaction().setRollbackOnly();
      throw e;
      }
      }
      }

      but when I'm trying run jBoss I'm getting the following Exception, that means that org/jboss/proxy/Interceptor class was not found,
      so how does other interceptors work? they use the same class?
      I was trying to add jboss.jar to jboss classpath but than another class was missing, and another... till the command line was
      too long.

      Does anyone know how can I solve this problem / what am I doing wrong?

      Thanks

      08:50:02,354 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedUR
      L@3c7280f4{ url=file:/D:/company/lastversion/jboss/server/default/deploy/Company-ejb.jar, deployedLastModified=0 }
      org.jboss.deployment.DeploymentException: Could not create deployment: file:/D:/company/lastversion/jboss/server/defa
      ult/deploy/Company-ejb.jar; - nested throwable: (java.lang.NoClassDefFoundError: org/jboss/proxy/Interceptor)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:777)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:620)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
      at sun.reflect.GeneratedMethodAccessor11.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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:261)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
      at sun.reflect.GeneratedMethodAccessor9.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:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:398)
      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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:249)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:569)
      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:517)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
      at org.jboss.Main.boot(Main.java:148)
      at org.jboss.Main$1.run(Main.java:381)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: java.lang.NoClassDefFoundError: org/jboss/proxy/Interceptor
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
      at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:247)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClassFromClassLoader(UnifiedLoaderRepository3.java:208)
      at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:119)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:140)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at org.jboss.ejb.EjbModule.addInterceptors(EjbModule.java:840)
      at org.jboss.ejb.EjbModule.initializeContainer(EjbModule.java:775)
      at org.jboss.ejb.EjbModule.createStatelessSessionContainer(EjbModule.java:583)
      at org.jboss.ejb.EjbModule.createContainer(EjbModule.java:538)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:363)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:136)
      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:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy5.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:315)
      at org.jboss.system.ServiceController.create(ServiceController.java:243)
      at sun.reflect.GeneratedMethodAccessor4.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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy9.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:377)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:760)
      ... 45 more