4 Replies Latest reply on Aug 24, 2005 4:25 PM by johnptoohey

    Problem with injboss - deployed as an ear

    johnptoohey Newbie

      System : Jboss 4.x JDL 1.4, latest AOP build.

      I copied the jboss-aop-deployer to my default/deploy directory. Modified the jboss-service.xml file like this

       <mbean code="org.jboss.aop.deployment.AspectManagerService"
       name="jboss.aop:service=AspectManager">
       <attribute name="EnableLoadtimeWeaving">true</attribute>
       <!-- only relevant when EnableLoadtimeWeaving is true.
       When transformer is on, every loaded class gets
       transformed. If AOP can't find the class, then it
       throws an exception. Sometimes, classes may not have
       all the classes they reference. So, the Suppressing
       is needed. (i.e. Jboss cache in the default configuration -->
       <attribute name="SuppressTransformationErrors">true</attribute>
       <attribute name="Prune">true</attribute>
       <attribute name="Include">org.jboss.test, org.jboss.injbossaop.</attribute>
       <attribute name="Exclude">org.jboss.</attribute>
       <attribute name="Optimized">true</attribute>
       <attribute name="Verbose">true</attribute>
       </mbean>
      
       <mbean code="org.jboss.aop.deployment.AspectDeployer"
       name="jboss.aop:service=AspectDeployer">
       </mbean>
      


      Built the new classloader and deployed it to jboss/bin. Modified the run.sh file as follows :-
      JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME -Xbootclasspath/p:jboss-classloader-transformer.jar:jdk14-pluggable-instrumentor.jar"
      


      Deployed the injboss example with ant deploy-ear

      Started JBoss and ran the test page. I can this in the log file :-
      2005-08-23 16:43:00,373 INFO [STDOUT] **** ExampleValue empty Constructor
      2005-08-23 16:43:00,378 INFO [STDOUT] **** ExampleValue.getMessage()
      2005-08-23 16:43:07,953 INFO [STDOUT] **** EarExampleServlet.service()
      2005-08-23 16:43:08,056 INFO [STDOUT] *** ExampleSessionBean.getValue()
      


      Also I see in the AOP console, all of my classes are unbound. Can anyone tell me what I am missing in my configuration.

      TIA

      John

        • 1. Re: Problem with injboss - deployed as an ear
          N Sharma Newbie

          Hi,

          I am also facing the problem in running this example (injboss). Please let me know if u have any luck.

          There is one little change which u might have to make if u r using windows, in the run.bat, instead of colon, u need to put semicolon between the name of two jar files.

          JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME -Xbootclasspath/p:jboss-classloader-transformer.jar:jdk14-plugga
          ble-instrumentor.jar"


          Let me if anything works.

          NS

          • 2. Re: Problem with injboss - deployed as an ear
            johnptoohey Newbie

            When I try ant deploy-ear-aop I get this in the logs :-

            15:49:04,567 INFO [EARDeployer] Init J2EE application: file:/Users/john/Dev-tools/jboss-4.0.2/server/default/deploy/aopexample.ear
            15:49:04,640 INFO [STDOUT] [debug] Looking for aspects in: org.jboss.injbossaop.lib.ExampleValue
            15:49:04,648 INFO [STDOUT] [debug] Looking for aspects in: org.jboss.injbossaop.lib.SimpleInterceptor
            15:49:04,651 INFO [STDOUT] [debug] Looking for aspects in: org.jboss.injbossaop.web.BasicExampleServlet
            15:49:04,656 INFO [STDOUT] [debug] Looking for aspects in: org.jboss.injbossaop.web.EarExampleServlet
            15:49:04,673 INFO [AspectDeployer] Deployed AOP: file:/Users/john/Dev-tools/jboss-4.0.2/server/default/tmp/deploy/tmp59995aopexample.ear-contents/aopexamplelib.aop
            15:49:04,762 INFO [EjbModule] Deploying ExampleSession
            15:49:04,873 INFO [EJBDeployer] Deployed: file:/Users/john/Dev-tools/jboss-4.0.2/server/default/tmp/deploy/tmp59995aopexample.ear-contents/aopexampleejb.jar
            15:49:04,897 INFO [TomcatDeployer] deploy, ctxPath=/aopexample, warUrl=file:/Users/john/Dev-tools/jboss-4.0.2/server/default/tmp/deploy/tmp59995aopexample.ear-contents/aopexample.war/
            15:49:05,070 INFO [EARDeployer] Started J2EE application: file:/Users/john/Dev-tools/jboss-4.0.2/server/default/deploy/aopexample.ear
            15:51:12,366 INFO [STDOUT] **** ExampleValue empty Constructor
            15:51:12,368 INFO [STDOUT] **** ExampleValue.getMessage()
            15:51:22,452 INFO [STDOUT] **** EarExampleServlet.service()
            15:51:22,459 INFO [STDOUT] *** ExampleSessionBean.getValue()
            15:51:22,460 INFO [STDOUT] **** ExampleValue String Constructor
            15:51:22,461 INFO [STDOUT] **** ExampleValue String Constructor
            15:51:22,511 INFO [STDOUT] **** ExampleValue.getMessage()

            It seems to look for the aspects in the deployed EAR, but when I run the test JSP, the example interceptor does not get called.

            Any help would be appreciated from anyone who has this working.

            Thanks,
            John

            • 3. Re: Problem with injboss - deployed as an ear
              N Sharma Newbie


              Did u tried any other ant targets like deploy-ct-war, deploy-ct-war-in-sar, etc.

              For me these are working fine, somehow the loadtime aops are not working for me either. So try the compiletime aops (ct) to see if interceptor works.

              NS

              • 4. Re: Problem with injboss - deployed as an ear
                johnptoohey Newbie

                Tried the compile time options, and these work :-). Thanks for your help. it is very much appreciated. I still need to get the runtime stuff to work for my application, but at least I have something to work on.

                John