9 Replies Latest reply on Feb 5, 2004 10:00 AM by rythos

    NPE in MethodTailInterceptor

    rythos

       

      "rythos" wrote:
      Hey there,

      I have a class which has had methods introduced on it. It also has some methods that are being advised. The methods that are being introduced are not affected by the advice. Now inside my advice I'm trying to deal with the new methods, and am having some issues.

      Point p = ( Point ) inv.targetObject;
      BoundPointInterface bp = ( BoundPointInterface ) inv.targetObject;

      bp.add(..)

      As soon as I call any method on the mixin class, I get the following NPE. The null object is the Method field in the MethodTailInterceptor. I've tried tracing where it's coming from, but I can't see where any null method could have been added. Any ideas?

      Thanks,
      Craig

      java.lang.NullPointerException
      at org.jboss.aop.ClassAdvisor$MethodTailInterceptor.invoke(ClassAdvisor.java:865)
      at org.jboss.aop.Invocation.invokeNext(Invocation.java:61)
      at org.jboss.aop.ClassAdvisor.invokeMethod(ClassAdvisor.java:729)
      at org.jboss.aop.ClassAdvisor.invokeMethod(ClassAdvisor.java:705)
      at bean.Point._added_m$0(Point.java)
      at bean.Point.addPropertyChangeListener(Point.java)
      at bean.jboss.BoundPointInterceptor.invoke(BoundPointInterceptor.java:43)
      at org.jboss.aop.Invocation.invokeNext(Invocation.java:61)
      at org.jboss.aop.ClassAdvisor.invokeMethod(ClassAdvisor.java:729)
      at org.jboss.aop.ClassAdvisor.invokeMethod(ClassAdvisor.java:705)
      at bean.Point._added_m$0(Point.java)
      at bean.Point.setX(Point.java)
      at bean.Point.bean$Point$setRectangular$WithoutAdvisement(Point.java:38)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.aop.ClassAdvisor$MethodTailInterceptor.invoke(ClassAdvisor.java:865)
      at org.jboss.aop.Invocation.invokeNext(Invocation.java:61)
      at org.jboss.aop.ClassAdvisor.invokeMethod(ClassAdvisor.java:729)
      at org.jboss.aop.ClassAdvisor.invokeMethod(ClassAdvisor.java:705)
      at bean.Point._added_m$0(Point.java)
      at bean.Point.setRectangular(Point.java)
      at bean.BeanRun.run(BeanRun.java:38)
      at common.GenericRun.start(GenericRun.java:39)
      at bean.jboss.Run.main(Run.java:19)


        • 1. Re: NPE in MethodTailInterceptor
          rythos

           

          "rythos" wrote:
          Found my problem. Forgot to add <mixin>...</mixin> inside the <introduction-pointcut> tags. Didn't notice them in the difference between the interface introduction example, and the mixin class example. Whoops!


          • 2. Re: NPE in MethodTailInterceptor
            marc.fleury

             

            "marc fleury" wrote:
            rythos,

            if you ever get in the codebase let us know. We are always looking for talented contributors


            • 3. Re: NPE in MethodTailInterceptor
              rythos

              What do you mean get in the codebase? I'm working on a project involving this product, and I'm happy to send someone important any bugs that I can track down during the creation of it. I just put them here cause someone else did ;)

              • 4. Re: NPE in MethodTailInterceptor
                bill.burke

                If you are interested in contributing let me know. I'm starting to do some serious enhancements to AOP and wouldn't mind a helper :)

                Bill

                • 5. Re: NPE in MethodTailInterceptor
                  marc.fleury

                  yeah yeah yeah come and help come and help.

                  marcf

                  • 6. Re: NPE in MethodTailInterceptor
                    rythos

                    You guys are funny :) I'm on my last term of my comp sci degree which is proving to be quite painful on the homework (reason why I'm here so often). When I eventually come out of this ring of fire if I'm still interested I'll give you a shout. In the mean time I'll just keep pestering with my random problems.

                    • 7. Re: NPE in MethodTailInterceptor
                      marc.fleury

                      this is how we recruit.

                      ooommmm we see the eye in you.. oooommmm

                      nah bullshit, just code a ton and get the stuff working and you are in.

                      You say you are done soon huh? hmmmmmm

                      • 8. Re: NPE in MethodTailInterceptor
                        bill.burke

                        JBOss AOP is homework? Can you elaborate?

                        FYI, we're always looking for new help. Open Source is largely volunteer which is why we encourage anybody who has a clue. You're digging into code, you may have a clue ;)

                        bill

                        • 9. Re: NPE in MethodTailInterceptor
                          rythos

                          Well, when the prof says "Make it work", I say "How high?" ;) Which is why I started digging into code.

                          I'm going to send you an e-mail elaborating on my homework, as I've heard it's a touchy subject and I don't really want to start a forum flame war :) This message is mainly to let random readers know I didn't ignore you after this.