]
Mike Lewis commented on JBAOP-706:
----------------------------------
We made the following change to an anon checkout of
:
svn diff
aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
Index:
aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
===================================================================
---
aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java (revision
85240)
+++
aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java (working
copy)
@@ -165,6 +165,6 @@
{
return getLoader();
}
- return SecurityActions.getClassLoader(advisor.getClass());
+ return advisor.getClassLoader();
}
}
This resolved the issue as manifested by the attached injbossPerIns example in our
environment
ClassNotFoundException for Aspect with PER_INSTANCE scope using
ClassicInstrumentor compile-time
-------------------------------------------------------------------------------------------------
Key: JBAOP-706
URL:
https://jira.jboss.org/jira/browse/JBAOP-706
Project: JBoss AOP
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Aspect Library
Affects Versions: 2.0.1.GA
Environment: OS: 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:06 UTC 2008 x86_64
GNU/Linux
Java: Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Jboss AS: JBoss [Morpheus] 5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)
Reporter: Mike Lewis
Attachments: injbossPerIns.tar.gz
When using ClassicInstrumentor for compile-time weaving of classes in a lib.aop archive
containing a PER_INSTANCE Aspect applied to a bean using a field pointcut, jboss-5.0.1.GA
throws a ClassNotFoundException for the Aspect when the field is accessed on an instance
of the bean.
I've attached a modified jboss-aop-2.0.1.GA/docs/aspect-framework/examples/injboss
example for this scenario
1. gunzip/untar injbossPerIns.tar.gz to
jboss-aop-2.0.1.GA/docs/aspect-framework/examples
2. cd to injbossPerIns
3. run ant -f build-jboss5.xml deploy-ear-ct
4. browse to
http://host:port/aopexample/srv
the following stacktrace is produced:
2009-02-27 13:49:34,498 DEBUG
[org.jboss.aop.microcontainer.beans.GenericBeanAspectFactory] (http-127.0.0.1-8080-1)
Creating advice org.jboss.injbossaop.lib.PerInsInterceptor with loader
org.jboss.system.NoAnnotationURLClassLoader@2b0a3b24
2009-02-27 13:49:34,499 ERROR [STDERR] (http-127.0.0.1-8080-1)
java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.jboss.injbossaop.lib.PerInsInterceptor
2009-02-27 13:49:34,499 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.microcontainer.beans.GenericBeanAspectFactory.doCreate(GenericBeanAspectFactory.java:151)
2009-02-27 13:49:34,499 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.microcontainer.beans.GenericBeanAspectFactory.createPerInstance(GenericBeanAspectFactory.java:105)
2009-02-27 13:49:34,499 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.InstanceAdvisorDelegate.initializeAspects(InstanceAdvisorDelegate.java:109)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.InstanceAdvisorDelegate.initialize(InstanceAdvisorDelegate.java:71)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.ClassInstanceAdvisor.setAdvisorAndInitialise(ClassInstanceAdvisor.java:88)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.ClassInstanceAdvisor.<init>(ClassInstanceAdvisor.java:72)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.injbossaop.lib.SomeObj._getInstanceAdvisor(SomeObj.java)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.injbossaop.lib.SomeObj.name_w_$aop(SomeObj.java)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.injbossaop.lib.SomeObj.setName(SomeObj.java:9)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.injbossaop.web.EarExampleServlet.org$jboss$injbossaop$web$EarExampleServlet$service$aop(EarExampleServlet.java:60)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.injbossaop.web.EarExampleServlet$service_8586428322187484014.invokeTarget(EarExampleServlet$service_8586428322187484014.java)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.injbossaop.lib.SimpleInterceptor.invoke(SimpleInterceptor.java:45)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.injbossaop.web.EarExampleServlet.service(EarExampleServlet.java)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
2009-02-27 13:49:34,500 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.lang.Thread.run(Thread.java:619)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) Caused by:
java.lang.ClassNotFoundException: org.jboss.injbossaop.lib.PerInsInterceptor
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.security.AccessController.doPrivileged(Native Method)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.lang.Class.forName0(Native Method)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
java.lang.Class.forName(Class.java:247)
2009-02-27 13:49:34,501 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.resolveComplexTypeInfo(IntrospectionTypeInfoFactoryImpl.java:419)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getTypeInfo(IntrospectionTypeInfoFactoryImpl.java:388)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory.getTypeInfo(IntrospectionTypeInfoFactory.java:54)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.classadapter.plugins.BasicClassAdapterFactory.getClassAdapter(BasicClassAdapterFactory.java:61)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.config.plugins.AbstractConfiguration.getBeanInfo(AbstractConfiguration.java:86)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.kernel.plugins.config.AbstractKernelConfig.getBeanInfo(AbstractKernelConfig.java:80)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.kernel.plugins.config.AbstractKernelConfigurator.getBeanInfo(AbstractKernelConfigurator.java:77)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.beans.metadata.plugins.factory.GenericBeanFactory.createBean(GenericBeanFactory.java:209)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.microcontainer.beans.ClassLoaderAwareGenericBeanFactory.createBean(ClassLoaderAwareGenericBeanFactory.java:70)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) at
org.jboss.aop.microcontainer.beans.GenericBeanAspectFactory.doCreate(GenericBeanAspectFactory.java:140)
2009-02-27 13:49:34,502 ERROR [STDERR] (http-127.0.0.1-8080-1) ... 35 more
2009-02-27 13:49:34,502 INFO [STDOUT] (http-127.0.0.1-8080-1) >>> Leaving
SimpleInterceptor
2009-02-27 13:49:34,503 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/aopexample].[EarExampleServlet]]
(http-127.0.0.1-8080-1) Servlet.service() for servlet EarExampleServlet threw exception
java.lang.ClassNotFoundException: org.jboss.injbossaop.lib.PerInsInterceptor
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.resolveComplexTypeInfo(IntrospectionTypeInfoFactoryImpl.java:419)
at
org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getTypeInfo(IntrospectionTypeInfoFactoryImpl.java:388)
at
org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory.getTypeInfo(IntrospectionTypeInfoFactory.java:54)
at
org.jboss.classadapter.plugins.BasicClassAdapterFactory.getClassAdapter(BasicClassAdapterFactory.java:61)
at
org.jboss.config.plugins.AbstractConfiguration.getBeanInfo(AbstractConfiguration.java:86)
at
org.jboss.kernel.plugins.config.AbstractKernelConfig.getBeanInfo(AbstractKernelConfig.java:80)
at
org.jboss.kernel.plugins.config.AbstractKernelConfigurator.getBeanInfo(AbstractKernelConfigurator.java:77)
at
org.jboss.beans.metadata.plugins.factory.GenericBeanFactory.createBean(GenericBeanFactory.java:209)
at
org.jboss.aop.microcontainer.beans.ClassLoaderAwareGenericBeanFactory.createBean(ClassLoaderAwareGenericBeanFactory.java:70)
at
org.jboss.aop.microcontainer.beans.GenericBeanAspectFactory.doCreate(GenericBeanAspectFactory.java:140)
at
org.jboss.aop.microcontainer.beans.GenericBeanAspectFactory.createPerInstance(GenericBeanAspectFactory.java:105)
at
org.jboss.aop.InstanceAdvisorDelegate.initializeAspects(InstanceAdvisorDelegate.java:109)
at org.jboss.aop.InstanceAdvisorDelegate.initialize(InstanceAdvisorDelegate.java:71)
at
org.jboss.aop.ClassInstanceAdvisor.setAdvisorAndInitialise(ClassInstanceAdvisor.java:88)
at org.jboss.aop.ClassInstanceAdvisor.<init>(ClassInstanceAdvisor.java:72)
at org.jboss.injbossaop.lib.SomeObj._getInstanceAdvisor(SomeObj.java)
at org.jboss.injbossaop.lib.SomeObj.name_w_$aop(SomeObj.java)
at org.jboss.injbossaop.lib.SomeObj.setName(SomeObj.java:9)
at
org.jboss.injbossaop.web.EarExampleServlet.org$jboss$injbossaop$web$EarExampleServlet$service$aop(EarExampleServlet.java:60)
at
org.jboss.injbossaop.web.EarExampleServlet$service_8586428322187484014.invokeTarget(EarExampleServlet$service_8586428322187484014.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.injbossaop.lib.SimpleInterceptor.invoke(SimpleInterceptor.java:45)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.injbossaop.web.EarExampleServlet.service(EarExampleServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: