0 Replies Latest reply on Apr 12, 2010 9:50 AM by Jonas Heineson

    Problem to get custom interceptor stack up and running.

    Jonas Heineson Newbie



      I have a problem getting an interceptor stack up and running on my JBoss (4.2.3.GA). The jboss starts fine, without any error messages, but when I connect a client to the server I get a NullPointerException suggesting that my Interceptor is not loaded (since it is the first one on the stack):



      Caused by: java.lang.NullPointerException
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          at org.jboss.ejb3.stateless.StatelessClusteredProxy.invoke(StatelessClusteredProxy.java:112)


      The stack in question is a modified version of the default ClusteredStatelessSessionClientInterceptors stack defined in ejb3-interceptors-aop.xml:



        <interceptor scope="PER_VM"/>


        <stack name="MtClusteredStatelessSessionClientInterceptors">
          <!--interceptor-ref name="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor"/-->   
          <interceptor-ref name="com.computas.mt.jboss.clustering.FixedServerInterceptor"/>
          <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
          <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
          <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
          <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>


      Annotations of SLSB class:

      @Clustered(loadBalancePolicy = FixedServerBalancer.class)
      @RemoteBinding(interceptorStack = "MtClusteredStatelessSessionClientInterceptors")
      public class MtEJBSingletonInvokerBean { ...}



      public class FixedServerInterceptor extends ClusteredIsLocalInterceptor {
        public Object invoke(Invocation invocation) throws Throwable {
          // doing some extra stuff
          return super.invoke(invocation);



      The jboss-aop.xml and the custom interceptor are both located in a module called mt-aop-<version>.aop which is in turn placed in an .ear together with the other modules of the application.


      Have also turned on instrumentation in the jboss-aop-jdk50.deployer/META-INF/jboss-service.xml

      What am I missing / doing wrong here?




      Jonas Heineson