[jboss-dev-forums] [Design of POJO Server] - AnnotatedClassFilter is wrong + AOP

adrian@jboss.org do-not-reply at jboss.com
Tue Mar 25 14:22:24 EDT 2008


The AnnotatedClassFilter has a number of problems.

1) It doesn't understand about "subdeployments" or in this particular case
that WEB-INF and WEB-INF/classes are in the classpath

e.g. 

  | 2008-03-25 18:17:10,505 DEBUG [org.jboss.classloader.spi.base.BaseClassLoader] (RMI TCP Connection(16)-127.0.0.1) Created BaseClassLoader at 1e3b325{vfsfile:/home/ejort/j
  | boss-head/testsuite/output/lib/aop-scopedear1.ear/aop-scopedear1.war} with policy 
  | ...
  | JarEntryContents at 27626654[path=aop-scopedear1.war/WEB-INF/classes JarEntryContents at 28507864[path=aop-scopedear1.war/WEB-INF 
  | ...
  | 

It tries to load each class twice


  | 2008-03-25 18:17:10,594 ERROR [STDERR] (RMI TCP Connection(16)-127.0.0.1) [error] Error converting class .. Do verbose mode if you want full stack trace.
  | 2008-03-25 18:17:10,595 DEBUG [org.jboss.deployment.AnnotatedClassFilter] (RMI TCP Connection(16)-127.0.0.1) Incomplete class: classes.org.jboss.test.aop.scoped.ear.se
  | rvlet.EarExampleServlet, NCDFE: java.lang.NoClassDefFoundError: classes/org/jboss/test/aop/scoped/ear/servlet/EarExampleServlet (wrong name: org/jboss/test/aop/scoped/
  | ear/servlet/EarExampleServlet)
  | 

Also, I don't think it understands how AOP is done?

2) With AOP there is also an in memory virtual file to store classes
that AOP has weaved. I think this is going to lead to the classes getting
processed twice? Once using the non-weaved version then using the
weaved version?

Which brings up another unrelated issue in that at the moment, 
I believe the in memory virtual file is after the unweaved virtual file in the classpath?

3) The current way of scanning classes for annotations is not scalable
(or even extensible).
It loads a collection of all classes found then runs each class through
the processors. This should be a true visitor pattern otherwise a deployment
with thousands of classes is possibly going to run out memory?

4) It doesn't take into account the classloading policy in that some parts of
the classpath could be excluded by filters.

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

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



More information about the jboss-dev-forums mailing list