[
https://jira.jboss.org/jira/browse/JBAS-6834?page=com.atlassian.jira.plug...
]
Adrian Brock commented on JBAS-6834:
------------------------------------
This looks like a hack in the aspect works class.
It assumes it can use the classloader to get a resource called WEB-INF/aop.xml
from WEB-INF/classes by doing a getResources("../aop.xml")
This usage is certainly not valid, though it would work with our old URLClassLoader
implementation,
it is very much relying on an implementation detail and non-spec behaviour.
In JBoss5 WEB-INF/classes is a root of the VFS so you can't "go off the top"
with the .. prefix
which is what the error message says.
The aspectwerkz class with the 'hack" is this one:
http://fisheye.codehaus.org/browse/~raw,r=1.25/aspectwerkz/aspectwerkz3/s...
I don't see anyway to override the behaviour in that class, so you need a patch to
it.
getResources("aop.xml") would work in JBoss5 since WEB-INF is a root of the
"classpath"
Although the correct place to put runtime resources is WEB-INF/classes which is required
by
spec to be in the classpath not WEB-INF which is not.
Aspectwerkz Class Load time weaving fails on JBoss AS 5.0.0.
------------------------------------------------------------
Key: JBAS-6834
URL:
https://jira.jboss.org/jira/browse/JBAS-6834
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: ClassLoading
Affects Versions: JBossAS-5.0.0.GA
Environment: jboss-5.0.0.GA
Aspectwerkz 2.0
java 1.6.0_06-b02
Reporter: Srikarthik Venkataraman
Assignee: Scott M Stark
Hi,
I am trying to deploy Aspectwerkz 2.0 based aspects targetting JEE application running on
jboss-5.0.0.GA.
I have deployed aspect jar file in the system classpath (JBOSS_HOME/server/default/lib)
In this environment the class load time weaving is not happening and throws the following
error:
2009-04-25 11:39:23,481 DEBUG
[org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy] (http-127.0.0.1-8080-1) Error
getting resources for MemoryContextHandler@17674604[path=
context=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z
real=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z]
java.io.IOException: Using reverse path on top file handler:
MemoryContextHandler@17674604[path=
context=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z
real=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z], ../aop.xml
at
org.jboss.virtual.plugins.context.AbstractVirtualFileHandler.structuredFindChild(AbstractVirtualFileHandler.java:528)
at
org.jboss.virtual.plugins.context.memory.MemoryContextHandler.getChild(MemoryContextHandler.java:105)
at org.jboss.virtual.VirtualFile.getChild(VirtualFile.java:451)
at
org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy.getResources(VFSClassLoaderPolicy.java:524)
at org.jboss.classloader.spi.base.BaseClassLoader$4.run(BaseClassLoader.java:628)
at java.security.AccessController.doPrivileged(Native Method)
at
org.jboss.classloader.spi.base.BaseClassLoader.getResourcesLocally(BaseClassLoader.java:624)
at
org.jboss.classloader.spi.base.BaseClassLoader.getResourcesLocally(BaseClassLoader.java:605)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:487)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:1134)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadResources(BaseClassLoader.java:432)
at
org.jboss.classloader.spi.base.BaseClassLoader.findResources(BaseClassLoader.java:418)
at java.lang.ClassLoader.getResources(ClassLoader.java:1015)
at
org.jboss.classloader.plugins.loader.ClassLoaderToLoaderAdapter.getResources(ClassLoaderToLoaderAdapter.java:163)
at
org.jboss.classloader.spi.ClassLoaderDomain.getResourcesFromParent(ClassLoaderDomain.java:540)
at
org.jboss.classloader.spi.ClassLoaderDomain.afterGetResources(ClassLoaderDomain.java:512)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:491)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:1134)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadResources(BaseClassLoader.java:432)
at
org.jboss.classloader.spi.base.BaseClassLoader.findResources(BaseClassLoader.java:418)
at java.lang.ClassLoader.getResources(ClassLoader.java:1015)
at
org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.registerClassLoader(SystemDefinitionContainer.java:122)
at
org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.registerClassLoader(SystemDefinitionContainer.java:104)
at
org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getHierarchicalDefinitionsFor(SystemDefinitionContainer.java:317)
at
org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getDefinitionsFor(SystemDefinitionContainer.java:225)
at org.codehaus.aspectwerkz.transform.inlining.ContextImpl.(ContextImpl.java:99)
at
org.codehaus.aspectwerkz.transform.inlining.InliningWeavingStrategy.newContext(InliningWeavingStrategy.java:259)
at
org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor._preProcess(AspectWerkzPreProcessor.java:166)
at
org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor.preProcess(AspectWerkzPreProcessor.java:148)
at
org.codehaus.aspectwerkz.hook.PreProcessorAdapter.transform(PreProcessorAdapter.java:50)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
at java.lang.reflect.Proxy.defineClass0(Native Method)
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:504)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at
org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:349)
at
org.jboss.ejb3.proxy.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
at
org.jboss.ejb3.proxy.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
at
org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:156)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1438)
at
org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1455)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:809)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.wipro.testweb.servlets.HelloWorldServlet.doGet(HelloWorldServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.wipro.testweb.filters.MyFilter.doFilter(MyFilter.java:42)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:828)
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)
2009-04-25 11:39:23,544 INFO [STDOUT] (http-127.0.0.1-8080-1)
******************************************************************
* ClassLoader =
BaseClassLoader@54a40c{vfszip:/D:/jboss-5.0.0.GA/server/default/deploy/PoCAMS.ear/PoCAMSWeb.war}@5547020
* SystemID = system, 2 aspects.
* SystemID = virtual_5547020, 1 aspects.
* vfszip:/D:/jboss-5.0.0.GA/server/default/lib/MyAspects.jar/META-INF/aop.xml
******************************************************************
2009-04-25 11:39:23,559 DEBUG
[org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy] (http-127.0.0.1-8080-1) Error
getting resources for MemoryContextHandler@17674604[path=
context=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z
real=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z]
java.io.IOException: Using reverse path on top file handler:
MemoryContextHandler@17674604[path=
context=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z
real=vfsmemory://a3z51w-zbluss-ftxwssm0-1-ftxwtzaq-1z], ../aop.xml
at
org.jboss.virtual.plugins.context.AbstractVirtualFileHandler.structuredFindChild(AbstractVirtualFileHandler.java:528)
at
org.jboss.virtual.plugins.context.memory.MemoryContextHandler.getChild(MemoryContextHandler.java:105)
at org.jboss.virtual.VirtualFile.getChild(VirtualFile.java:451)
at
org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy.getResources(VFSClassLoaderPolicy.java:524)
at org.jboss.classloader.spi.base.BaseClassLoader$4.run(BaseClassLoader.java:628)
at java.security.AccessController.doPrivileged(Native Method)
at
org.jboss.classloader.spi.base.BaseClassLoader.getResourcesLocally(BaseClassLoader.java:624)
at
org.jboss.classloader.spi.base.BaseClassLoader.getResourcesLocally(BaseClassLoader.java:605)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:487)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:1134)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadResources(BaseClassLoader.java:432)
at
org.jboss.classloader.spi.base.BaseClassLoader.findResources(BaseClassLoader.java:418)
at java.lang.ClassLoader.getResources(ClassLoader.java:1015)
at
org.jboss.classloader.plugins.loader.ClassLoaderToLoaderAdapter.getResources(ClassLoaderToLoaderAdapter.java:163)
at
org.jboss.classloader.spi.ClassLoaderDomain.getResourcesFromParent(ClassLoaderDomain.java:540)
at
org.jboss.classloader.spi.ClassLoaderDomain.afterGetResources(ClassLoaderDomain.java:512)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:491)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getResources(BaseClassLoaderDomain.java:1134)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadResources(BaseClassLoader.java:432)
at
org.jboss.classloader.spi.base.BaseClassLoader.findResources(BaseClassLoader.java:418)
at java.lang.ClassLoader.getResources(ClassLoader.java:1015)
at java.lang.ClassLoader.getResources(ClassLoader.java:1011)
at
org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.registerClassLoader(SystemDefinitionContainer.java:122)
at
org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getHierarchicalDefinitionsFor(SystemDefinitionContainer.java:317)
at
org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getDefinitionsFor(SystemDefinitionContainer.java:225)
at org.codehaus.aspectwerkz.transform.inlining.ContextImpl.(ContextImpl.java:99)
at
org.codehaus.aspectwerkz.transform.inlining.InliningWeavingStrategy.newContext(InliningWeavingStrategy.java:259)
at
org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor._preProcess(AspectWerkzPreProcessor.java:166)
at
org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor.preProcess(AspectWerkzPreProcessor.java:148)
at
org.codehaus.aspectwerkz.hook.PreProcessorAdapter.transform(PreProcessorAdapter.java:50)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
at java.lang.reflect.Proxy.defineClass0(Native Method)
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:504)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at
org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:349)
at
org.jboss.ejb3.proxy.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
at
org.jboss.ejb3.proxy.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
at
org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:156)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1438)
at
org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1455)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:809)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.wipro.testweb.servlets.HelloWorldServlet.doGet(HelloWorldServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.wipro.testweb.filters.MyFilter.doFilter(MyFilter.java:42)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:828)
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)
Please note weaving happens successfully for this exact same setup using Aspectwerkz 2.0
on jboss-4.2.2.GA in java 1.5.0 environment.
Please let me know if there are any changes or workaround required in jboss-5.0.0
environment for running Aspectwerkz 2.0 based aspects.
Regards,
Srikarthik
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira