[jboss-user] [JBoss AOP] - Re: NullPointerException in MethodJoinPointGenerator

Sebastien Pennec do-not-reply at jboss.com
Mon May 23 03:35:49 EDT 2011


Sebastien Pennec [http://community.jboss.org/people/spennec] created the discussion

"Re: NullPointerException in MethodJoinPointGenerator"

To view the discussion, visit: http://community.jboss.org/message/606496#606496

--------------------------------------------------------------
Ok I went into the code of the MethodJoinPointGenerator: the MethodInfo that is used in the constructor returns a null "unadvisedMethod". In the MethodInfo constructor, there are two hashes passed as parameters: they usually are different values that return different methods from a "method catalog". It's the MethodHashing.findMethodByHash() that returns the method that corresponds to each hash.


In my situation, the findMethodByHash returns null. So either the MethodHashing class populates its "methodHashesByClass" incorrectly and forgets a method, or the class that builds the hash sends in a nonexistent hash.


Does it help you help me?  :)  I really need to get this working... 


Here is the code that I am talking about, from MethodInfo:


   @SuppressWarnings("deprecation")
   public MethodInfo(Class<?> clazz, long hash, long unadvisedHash, Advisor advisor)
   {
      super(advisor, clazz);

      try
      {
         this.hash = hash; 
         advisedMethod = MethodHashing.findMethodByHash(clazz, hash);
         unadvisedMethod = MethodHashing.findMethodByHash(clazz, unadvisedHash);
         this.setAdvisor(advisor);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
   }
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/606496#606496]

Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2027]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110523/4bdf051b/attachment-0001.html 


More information about the jboss-user mailing list