10 Replies Latest reply on Apr 8, 2005 12:26 AM by javajedi

    injboss example doesn't seem to work

      Sorry for the newbie question. I've spent the better part of a day playing with this and still haven't had any success. I'm running JBoss 4.0.1 under JDK 1.5 on Linux. I downloaded jboss-aop 1.1.1. I replaced jboss-aop.deployer in my deploy directory with jboss-aop-jdk50.deployer. I placed pluggable-instrumentor.jar in my bin directory and added "-javaagent:pluggable-instrumentor.jar" to run.conf (the docs have a typo, BTW. They specify -javaagent= instead of -javaagent:.) I found the injboss example and ran "ant ear". I then copied aopexample.ear into my deploy directory. So far so good, it looks like it deployed fine. When I go to http://localhost:8080/aopexample, I see the following sent to stdout:

      [STDOUT] **** ExampleValue.getMessage()

      When I hit "Submit Query", I get the following to stdout:

      [STDOUT] **** EarExampleServlet.service()
      [STDOUT] *** ExampleSessionBean.getValue()
      [STDOUT] **** ExampleValue String Constructor
      [STDOUT] **** ExampleValue String Constructor
      [STDOUT] **** ExampleValue.getMessage()

      Shouldn't I be seeing the "<<< Entering SimpleInterceptor:" messages? Any idea what I'm doing wrong?

        • 1. Re: injboss example doesn't seem to work
          drakonis

          I may need to suscribe to the same problem, although i'm kinda new to jboss and total beginer with aop, but it kinda lacks any first stepts into jboss aop.
          Was following the docs on
          http://docs.jboss.org/aop/1.1/aspect-framework/examples/injboss/aopInJbossPackaging.html . There it says


          All the examples shown here use loadtime transformations, so you will need to modify your jboss/server/--yourconfig--/conf/jboss-service.xml as outlined in Running with JBoss Application Server
          The running with Jboss Application Server is a dead link however. Points to http://docs.jboss.org/aop/1.1/aspect-framework/misc/running_jboss.html which is missing on the site and in the doc. that come with jboss-aop_1.1.1.zip too. So i may belive that the answer to the question lies with that and will be forever lost to us mere mortals:).

          I modified the build xml to go for the default starting of the server.
          Went for ant deploy-basic-lt-war which at the end says "Classes have not been aop'ed - run JBoss with enable transformations = true" Did a google on that, nothing was found. However in a post i found that someone set
          EnableTransformer to true in the /default/conf/jboss-service.xml . I myself have not any EnableTransformer in jboss-service.xml to be set.

          But javajedi if u'll be kind to answer where did u read about the pluggable-instrumentor.jar . I have not found any reference to it. Is it necesary?

          Well hope someone has any answers.

          • 2. Re: injboss example doesn't seem to work
            bill.burke

            Please read our documentation. It comes with both the distribution and is online here:

            http://docs.jboss.org/aop/1.1/aspect-framework/reference/en/html/running.html

            The JBoss 3.2.x integration is broken with 1.1.1. It will be fixed with 1.1.2.

            • 3. Re: injboss example doesn't seem to work

              Already read those docs, and I do have EnableTransformer set to "true". I'm using JBoss 4.0.1.

              • 4. Re: injboss example doesn't seem to work
                bill.burke

                Jedi. I was talking to drakonis. I'll see if I can reproduce your problem with JDK5/JB4/pluggable_instrumentor

                • 5. Re: injboss example doesn't seem to work

                  Thanks for the reply Bill. I figured out what my problem was. In ear-deployer.xml, I had the "Isolated" attribute set to true. Setting it back to false made all of the AOP stuff start working. Is there any way to use JBoss AOP with isolated class loaders enabled?

                  • 6. Re: injboss example doesn't seem to work
                    bill.burke

                    Ok, Jedi, I was unable to reproduce your problem on JBoss 4.0.1SP1.

                    I think I know what your problem is though.

                    You must run 'ant deploy-ear'. This target will deploy the aopexample.ear file AS WELL AS a 'jboss-aop.xml' file to the deploy directory.

                    If you run the 'ant deploy-ear-aop' target, it will create an EAR with a aopexample.aop jar file within the ear.

                    • 7. Re: injboss example doesn't seem to work
                      bill.burke

                      Does it work with the 'ant deploy-ear-aop' target? This actually embedds an .aop file within the .ear file. I'll try this out myself.

                      • 8. Re: injboss example doesn't seem to work

                        That target works fine with isolated class loading disabled. With it enabled, the example doesn't work.

                        • 9. Re: injboss example doesn't seem to work
                          bill.burke

                          The 'ant deploy-ear-aop' works fine for me with scoped classloading, JDK5, javaagent, JBOss 4.0.1sp1. Maybe sp1 is the difference.

                          <jboss-app>
                           <loader-repository>
                           dot.com:loader=unique-archive-name
                           <loader-repository-config>
                           java2ParentDelegaton=false
                           </loader-repository-config>
                           </loader-repository>
                          </jboss-app>
                          
                          


                          • 10. Re: injboss example doesn't seem to work

                            Hmmm...that's very strange. I downloaded JBoss 4.0.1sp1, installed jboss-aop 1.1.1, and ran ant deploy-ear-aop on in injboss example. JDK 1.5, Linux. Example worked fine. Added the jboss-app.xml from your post to aopexample.ear, example didn't work. Removed the jboss-app.xml, turned on isolated class loaders in ear-deployer.xml, example didn't work. Every time I turn on an isolated class loader, I get:

                            INFO [STDOUT] **** EarExampleServlet.service()
                            INFO [STDOUT] *** ExampleSessionBean.getValue()
                            INFO [STDOUT] **** ExampleValue String Constructor
                            INFO [STDOUT] **** ExampleValue String Constructor
                            INFO [STDOUT] **** ExampleValue.getMessage()

                            What could be different in our environments?