2 Replies Latest reply on Dec 5, 2004 7:06 AM by Sudhir Reddy

    Compiling and Pluging my own interceptor in JBoss

    Sudhir Reddy Newbie

      I want to write my own Interceptor for JBoss EJB Container and plug it into JBoss 3.2.5 application server. (NOTE: Not compiling with JBoss Source, I am writing it seperately and plug in to it)

      I am having problem compiling my Interceptor.

      javac MyLogInterceptor.java -classpath /home/sudhir/JBoss/jboss-3.2.5/server/default/lib/jboss.jar:/home/sudhir/J2EE/j2sdkee1.3/lib/j2ee.jar
      

      I dont know what all packages are to be included during the compilation of this file. I tried including jboss.jar and also j2ee.jar, still its giving the following message

      cannot access org.jboss.system.Service
      file org/jboss/system/Service.class not found
      public class MyLogInterceptor extends AbstractInterceptor
       ^
      MyLogInterceptor.java:53: cannot resolve symbol
      symbol : class Invocation
      location: class org.jboss.ejb.plugins.MyLogInterceptor
       public Object invokeHome(Invocation invocation) throws Exception
       ^
      


      Can some one who has worked with them, please help me on compiling it and pluging it in or give some pointers. I tried to look but could not find any.

      PS: In case this is the not the forum where this message is to be posted, do inform me the correct one. I cudnt find any appropriate forum for this question.



        • 1. Re: Compiling and Pluging my own interceptor in JBoss
          Juha Lindfors Master

          Try:

          javac MyLogInterceptor.java -classpath /home/sudhir/JBoss/jboss-3.2.5/server/default/lib/jboss.jar:/home/sudhir/JBoss/jboss-3.2.5/lib/jboss-system.jar:/home/sudhir/JBoss/jboss-3.2.5/lib/jboss-common.jar:/
          home/sudhir/J2EE/j2sdkee1.3/lib/j2ee.jar

          • 2. Re: Compiling and Pluging my own interceptor in JBoss
            Sudhir Reddy Newbie

            Thanks Juha Lindfors,

            I was able to compile the file using:

            javac MyLogInterceptor.java -classpath $JBOSS_HOME/server/default/lib/jboss.jar:$JAVAX_JAR:$JBOSS_HOME/lib/jboss-system.jar:$JBOSS_HOME/server/default/lib/jboss-management.jar:$JBOSS_HOME/lib/jboss-jmx.jar
            


            Now how to plug this in ?.

            I compiled and added this MyLogInterceptor.class to the JBOSS_CLASSPATH, and added the following line to the standardjboss.xml
            <container-interceptors>
             <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.MyLogInterceptor</interceptor>
            
            

            but getting the following errors:

            16:52:19,815 INFO [EjbModule] Deploying SequenceSes
            16:52:19,826 WARN [EjbModule] Could not load the org.jboss.ejb.plugins.MyLogInterceptor interceptor for this container
            java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.ejb.plugins.MyLogInterceptor
             at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:275)
             at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:178)
             at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:132)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
            


            MyLogInterceptor is a server side interceptor which extends AbstractInterceptor and has the package name as org.jboss.ejb.plugins.

            Am I doing something wrong ?