0 Replies Latest reply: Aug 18, 2011 6:29 AM by Fekete Kamosh RSS

    Intercepted no-interface beans have problem to be injected?

    Fekete Kamosh Newbie

      Hi,

      I want to create my first interceptor for logging elapsed time of methods.

      Everything is fine for stateless session bean TestBeanA which has explicitly defined local interface. But usage of no-interface session bean TestBeanC causes problem if combined with interceptor either in time of deploy or later when methods are called.

       

      Environment:

      . JBoss-6.0.0.Final server

      . JDK 1.6.0_26

      . Windows XP Professional SP3

       

       

      I would start with example code and the describe problems

       

      Interceptor itself:

      package cz.test;
      
      import org.jboss.aop.joinpoint.MethodInvocation;
      
      public class MyJBossLogInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable {
      
          @Override
          public String getName() {
              return toString();
          }
      
          public Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
                  throws Throwable {        
              if (!(invocation instanceof MethodInvocation)) {
                  return invocation.invokeNext();
              }
      
              MethodInvocation methodInvocation = (MethodInvocation) invocation;
              final String prefix = methodInvocation.getMethod().getDeclaringClass().getName() +"." + methodInvocation.getMethod().getName() + " ";
              final long methodStart = System.currentTimeMillis();
              System.out.println(prefix + "start");
              try {
                  return invocation.invokeNext();
              } finally {
                  System.out.println(prefix + "end. Elapsed time: " + (System.currentTimeMillis() - methodStart));
              }
          }
      }
      

       

      File my-log-interceptors-aop.xml I put into deploy directory:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <aop xmlns="urn:jboss:aop-beans:1.0">
      
         <interceptor class="cz.test.MyJBossLogInterceptor" scope="PER_INSTANCE"/>
      
        <bind pointcut="execution(* cz.test.beans..->*(..))">
               <interceptor-ref name="cz.test.MyJBossLogInterceptor"/>
         </bind>
      
      </aop> 
      

       

      Session beans:

      package cz.test.beans;
      
      import javax.ejb.EJB;
      import javax.ejb.Remote;
      import javax.ejb.Stateless;
      
      @Stateless
      @Remote(TestBeanARemote.class)
      public class TestBeanA implements TestBeanARemote {
      
          @EJB
          TestBeanBLocal testBeanB;   
      
          //@EJB
          //TestBeanC testBeanC;
      
          public void methodA() {
              System.out.println("TestBeanA.methodA");
              testBeanB.methodB();
              //testBeanC.methodC();
          }
      
      }
      

       

      package cz.test.beans;
      
      public interface TestBeanARemote {
          public void methodA();
      }
      

       

      package cz.test.beans;
      
      import javax.ejb.Local;
      import javax.ejb.Stateless;
      
      @Stateless
      @Local(TestBeanBLocal.class)
      public class TestBeanB implements TestBeanBLocal {
      
          public void methodB() {
              System.out.println("TestBeanB.methodB");
          }
      }
      

       

      package cz.test.beans;
      
      public interface TestBeanBLocal {
      
          void methodB();
      
      }
      

       

      package cz.test.beans;
      
      import javax.ejb.LocalBean;
      import javax.ejb.Stateless;
      
      /**
       * Session Bean implementation class TestBeanC
       */
      @Stateless
      //@LocalBean
      public class TestBeanC {
      
          public void methodC() {
              System.out.println("TestBeanC.methodC");
          }
      }
      

       

      Remote client:

      package cz.test;
      
      import java.util.Properties;
      
      import javax.naming.Context;
      import javax.naming.InitialContext;
      import javax.naming.NamingException;
      
      import cz.test.beans.TestBeanARemote;
      
      public class EJBClient {
      
          private static final String JNDI_PREFIX = "MDBTesting" ;
      
          // Constant setting for JBoss JNDI
          private static final String FACTORY_INITIAL = "org.jnp.interfaces.NamingContextFactory";
          private static final String FACTORY_URL_PKGS = "org.jboss.naming:org.jnp.interfaces";
          private static final String URL = "localhost:1099";    
      
          public static void main(String[] args) throws NamingException {                        
              TestBeanARemote bean1Remote = (TestBeanARemote)getContext().lookup(JNDI_PREFIX+"/TestBeanA/remote");
              bean1Remote.methodA();
          }
      
          private static Context getContext() {
              try {
                  Properties p = new Properties();
                  p.put(Context.INITIAL_CONTEXT_FACTORY, FACTORY_INITIAL);
                  p.put(Context.URL_PKG_PREFIXES, FACTORY_URL_PKGS);
                  p.put(Context.PROVIDER_URL, URL);
                  return new InitialContext(p);
              } catch (NamingException e) {
                  throw new RuntimeException(e);
              }
          }
      }
      

       

      In conf/bootstrp/aop.xml changed:

      <property name="enableLoadtimeWeaving">true</property>
      

       

      JBoss is launched using:

       -javaagent:pluggable-instrumentor.jar
      

       

      Pluggable-instrumentor:

      pluggable-instrumentor.jar has been copied to bin directory

       

       

      Description of behaviour

       

      Case 1 - if you remove comments in TestBeanA you will get ERRORs in server output during deploy:

      08:04:37,651 ERROR [AbstractKernelController] Error installing to Real: name=vfs:///C:/jboss-6.0.0.Final/server/interceptortesting/deploy/MDBTesting.ear state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error during deploy: org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.TestBeanA
          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:185) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
          at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
          at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.0.0.Final]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at java.lang.Thread.run(Thread.java:619) [:1.6.0_16]
      Caused by: java.lang.RuntimeException: Could not resolve @EJB reference: [EJB Reference: beanInterface 'cz.test.beans.TestBeanC', beanName 'null', mappedName 'null', lookupName 'null', owning unit 'ComponentDeploymentContext@21217974{org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.TestBeanA}'] for environment entry: env/cz.test.beans.TestBeanA/testBeanC in unit ComponentDeploymentContext@21217974{org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.TestBeanA}
          at org.jboss.ejb3.jndi.deployers.resource.provider.AnnotatedEJBRefResourceProvider.provide(AnnotatedEJBRefResourceProvider.java:99) [:0.1.7]
          at org.jboss.ejb3.jndi.deployers.resource.provider.AnnotatedEJBRefResourceProvider.provide(AnnotatedEJBRefResourceProvider.java:50) [:0.1.7]
          at org.jboss.switchboard.mc.JndiEnvironmentProcessor.process(JndiEnvironmentProcessor.java:68) [:1.0.0-alpha-15]
          at org.jboss.switchboard.mc.deployer.AbstractSwitchBoardDeployer.process(AbstractSwitchBoardDeployer.java:119) [:1.0.0-alpha-15]
          at org.jboss.switchboard.mc.deployer.EJBEnvironmentSwitchBoardDeployer.internalDeploy(EJBEnvironmentSwitchBoardDeployer.java:87) [:1.0.0-alpha-15]
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
          ... 45 more
      
      08:04:37,713 INFO  [service] Removing bootstrap log handlers
      08:04:37,791 ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS IN ERROR:
        Deployment "vfs:///C:/jboss-6.0.0.Final/server/interceptortesting/deploy/MDBTesting.ear" is in error due to the following reason(s): java.lang.RuntimeException: Could not resolve @EJB reference: [EJB Reference: beanInterface 'cz.test.beans.TestBeanC', beanName 'null', mappedName 'null', lookupName 'null', owning unit 'ComponentDeploymentContext@21217974{org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.TestBeanA}'] for environment entry: env/cz.test.beans.TestBeanA/testBeanC in unit ComponentDeploymentContext@21217974{org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.TestBeanA}
      
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
          at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at java.lang.Thread.run(Thread.java:619) [:1.6.0_16]
      

       

      Case 2 - if you remove comments in TestBeanA and you remove comment in TestBeanC so that it is annotated with @javax.ejb.LocalBean you will get exception on client side:   

      Exception in thread "main" javax.ejb.EJBException: Cannot invoke method getCurrentAdvisor$aop on nointerface view
          at org.jboss.ejb3.nointerface.impl.invocationhandler.NoInterfaceViewInvocationHandler.invokeEndpoint(NoInterfaceViewInvocationHandler.java:134)
          at org.jboss.ejb3.nointerface.impl.invocationhandler.NoInterfaceViewInvocationHandler.access$000(NoInterfaceViewInvocationHandler.java:54)
          at org.jboss.ejb3.nointerface.impl.invocationhandler.NoInterfaceViewInvocationHandler$1.invoke(NoInterfaceViewInvocationHandler.java:103)
          at org.jboss.ejb3.sis.reflect.InterceptorInvocationHandler$1.proceed(InterceptorInvocationHandler.java:84)
          at org.jboss.ejb3.sis.InterceptorAssembly$1.proceed(InterceptorAssembly.java:82)
          at org.jboss.ejb3.nointerface.impl.async.AsyncClientInterceptor.invoke(AsyncClientInterceptor.java:119)
          at org.jboss.ejb3.sis.InterceptorAssembly$1.proceed(InterceptorAssembly.java:74)
          at org.jboss.ejb3.nointerface.impl.invocationhandler.ObjectMethodsInterceptor.invoke(ObjectMethodsInterceptor.java:78)
          at org.jboss.ejb3.sis.InterceptorAssembly$1.proceed(InterceptorAssembly.java:74)
          at org.jboss.ejb3.sis.InterceptorAssembly.invoke(InterceptorAssembly.java:90)
          at org.jboss.ejb3.sis.reflect.InterceptorInvocationHandler.invoke(InterceptorInvocationHandler.java:110)
          at org.jboss.ejb3.nointerface.impl.invocationhandler.NoInterfaceViewInvocationHandler.invoke(NoInterfaceViewInvocationHandler.java:115)
          at org.jboss.ejb3.proxy.javassist.JavassistInvocationHandlerAdapter.invoke(JavassistInvocationHandlerAdapter.java:71)
          at cz.test.beans.TestBeanC_$$_javassist_3.getCurrentAdvisor$aop(TestBeanC_$$_javassist_3.java)
          at cz.test.beans.TestBeanC_$$_javassist_3.methodC(TestBeanC_$$_javassist_3.java)
          at cz.test.beans.TestBeanA.cz$test$beans$TestBeanA$methodA$aop(TestBeanA.java:20)
          at cz.test.beans.TestBeanA$JoinPoint_methodA6334692424547308238.dispatch(TestBeanA$JoinPoint_methodA6334692424547308238.java)
          at cz.test.beans.JoinPoint_methodA6334692424547308238_1.invokeNext(JoinPoint_methodA6334692424547308238_1.java)
          at cz.test.MyJBossLogInterceptor.invoke(MyJBossLogInterceptor.java:23)
          at cz.test.beans.JoinPoint_methodA6334692424547308238_1.invokeNext(JoinPoint_methodA6334692424547308238_1.java)
          at cz.test.beans.JoinPoint_methodA6334692424547308238_1.invokeJoinpoint(JoinPoint_methodA6334692424547308238_1.java)
          at cz.test.beans.TestBeanA$TestBeanAAdvisor.methodA6334692424547308238(TestBeanA$TestBeanAAdvisor.java)
          at cz.test.beans.TestBeanA$TestBeanAInstanceAdvisor.methodA6334692424547308238(TestBeanA$TestBeanAInstanceAdvisor.java)
          at cz.test.beans.TestBeanA.methodA(TestBeanA.java)
          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.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
          at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:162)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)
          at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_7320534.invoke(InvocationContextInterceptor_z_fillMethod_7320534.java)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)
          at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_7320534.invoke(InvocationContextInterceptor_z_setup_7320534.java)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
          at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:392)
          at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
          at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
          at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
          at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)
          at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
          at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
          at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
          at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
          at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:216)
          at org.jboss.remoting.Client.invoke(Client.java:1961)
          at org.jboss.remoting.Client.invoke(Client.java:804)
          at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
          at $Proxy4.invoke(Unknown Source)
          at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
          at $Proxy3.methodA(Unknown Source)
          at cz.test.EJBClient.main(EJBClient.java:22)
          at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
          at $Proxy4.invoke(Unknown Source)
          at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
          at $Proxy3.methodA(Unknown Source)
          at cz.test.EJBClient.main(EJBClient.java:22)
      

       

      What seems strange for me, server log contains (notice there is nothing about TestBeanC)

      08:33:19,968 INFO  [STDOUT] cz.test.beans.TestBeanA.methodA start
      08:33:19,968 INFO  [STDOUT] TestBeanA.methodA
      08:33:20,109 INFO  [STDOUT] cz.test.beans.TestBeanB.methodB start 
      08:33:20,109 INFO  [STDOUT] TestBeanB.methodB
      08:33:20,109 INFO  [STDOUT] cz.test.beans.TestBeanB.methodB end. Elapsed time: 0
      08:33:20,125 INFO  [STDOUT] cz.test.beans.TestBeanA.methodA end. Elapsed time: 157
      

       

      Case 3 - if you remove comments from and and remove my-log-interceptors-aop.xml from deploy directory (interceptor is not applied)

      Everything is fine and I server log contains:
      08:26:17,250 INFO  [STDOUT] TestBeanA.methodA
      08:26:17,266 INFO  [STDOUT] TestBeanB.methodB
      08:26:17,266 INFO  [STDOUT] TestBeanC.methodC
      

       

       

      Similar problem has been discussed already here on forum http://community.jboss.org/thread/164703 but I did not find there any solution

       

      Is it a bug or am I doing something wrong?

       

      Please help

       

      Fekete Kamosh