Flavia Rainone [http://community.jboss.org/people/flavia.rainone%40jboss.com] 
created the discussion

"Adding org.apache.log4j and org.junit to nonAdvisablePackages"

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

--------------------------------------------------------------
I've just discovered that UserDefinedClassLoaderTestCase is failing for ages 
now and nobody ever noticed because another failure happens when Junit is 
printing the report.

I've just fixed the initial failure, but I would also like to prevent the 
second failure to happen (i.e., if there is a failure, we want to to make sure 
we see that failure reported).

The cause of that second failure is an OutOfMemoryError, result of an endless 
instrumentation loop JBoss AOP enters because of calls to logger in 
JoinPointGenerator. Whenever such a call is found, JBoss AOP tries to weave the 
class. Since there was a problem in the classloader used by the test (fixed 
now), the class is not found and the same JoinPointGenerator try to log an 
error again, entering a infinite loop state.

Another problem that I saw is that, when Junit tries to generate the report, it 
uses org.junit packaged classes to do so, and JBoss AOP enters the loop again.

Despite the particularities of the aforementioned test, that was buggy, I think 
we should avoid weaving classes from those packages. Doing otherwise can:
- cause several deadlock problems because AOP startes the weaving process from 
inside the weaving process, in the case of org.apache.log4j (as seen before 
with other classes)
- cause problems when somebody is running a test that involves JBoss AOP with 
Junit, in the case of org.junit.

Can I add those packages to the isNonAdvisableClassName methods?

--------------------------------------------------------------

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

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

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to