[jboss-user] [JBoss AOP] - Re: Multiple ClassLoaders problem?

flavia.rainone@jboss.com do-not-reply at jboss.com
Thu Jun 26 09:50:08 EDT 2008

anonymous wrote : unless org.drftpd.vfs.index.lucene.SimpleInterceptor is not visible to org.drftpd.vfs.InodeHandle?

I am starting to think that this is the case. Look at a simplified view of what JBoss AOP does to your code:

  | class InodeHandle
  | {
  |    private static transient InodeHandleAdvisor advisor = new InodeHandleAdvisor();
  |    public String toString()
  |    {
  |        return advisor.toStringXXXXX();
  |     }
  |     private class InodeHandleAdvisor extends GeneratedClassAdvisor
  |    {
  |        public String toStringXXXX()
  |        {
  |            ...
  |            super.generateJoinPointClass(....);
  |            ...
  |         }
  |    }

The first time InodeHandleAdvisor.toStringXXX is executed, it will generate code that calls your interceptor. For that, it will need to load your interceptor class, and it will use the class loader that loaded InodeHandleAdvisor to load your interceptor. Well, given the fact that this class is loaded when the static advisor field gets initialized, we can conclude that the class loader used is the same that loaded InodeHandle. If it can't load the interceptor class, I conclude that the interceptor is not visible to the class loader that loaded InodeHandle.

Can you check if this is the case?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160875#4160875

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160875

More information about the jboss-user mailing list