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

    NPE in MethodTailInterceptor

    rythos Newbie

       

      "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)