JBoss Community

Re: NullPointerException in MethodJoinPointGenerator

created by Sebastien Pennec in JBoss AOP - View the full discussion

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

Start a new discussion in JBoss AOP at Community