[JBoss AOP] New message: "Cannot get AOP to run in webapp"
by Dennis Kuehn
User development,
A new message was posted in the thread "Cannot get AOP to run in webapp":
http://community.jboss.org/message/530222#530222
Author : Dennis Kuehn
Profile : http://community.jboss.org/people/mwx.dennis
Message:
--------------------------------------------------------------
Hi!
After working with JBoss AOP successfully (I'm using standalone mode with loadtime instrumentation) I tried to instrument a web application running inside a Tomcat container.
This worked well for a very simple webapp but now, with a big and complex app, I'm in trouble.
Whatever class I'm trying to instrument, no matter if it exists or not, I get the following log output when Tomcat starts:
[ERROR] Error converting class .. Do verbose mode if you want full stack trace. @org.jboss.aop.util.logging.AOPLogger.error
How do I "do verbose mode"? I'm using log4j.
Problems get more concrete when I try to instrument a class which actually exists in the project:
javassist.CannotCompileException: [source error] getDomainName(java.lang.Class,boolean) not found in org.jboss.aop.Domain
at javassist.CtBehavior.setBody(CtBehavior.java:368)
at javassist.CtBehavior.setBody(CtBehavior.java:334)
at javassist.CtNewMethod.make(CtNewMethod.java:137)
at org.jboss.aop.instrument.GeneratedAdvisorInstrumentor.createAdvisorCtors(GeneratedAdvisorInstrumentor.java:427)
at org.jboss.aop.instrument.GeneratedAdvisorInstrumentor.createAdvisorClass(GeneratedAdvisorInstrumentor.java:313)
at org.jboss.aop.instrument.GeneratedAdvisorInstrumentor.doSetupBasics(GeneratedAdvisorInstrumentor.java:561)
at org.jboss.aop.instrument.Instrumentor.setupBasics(Instrumentor.java:949)
at org.jboss.aop.instrument.MethodExecutionTransformer.instrument(MethodExecutionTransformer.java:143)
at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:744)
at org.jboss.aop.instrument.GeneratedAdvisorInstrumentor.transform(GeneratedAdvisorInstrumentor.java:117)
at org.jboss.aop.SuperClassesFirstWeavingStrategy.instrumentClass(SuperClassesFirstWeavingStrategy.java:202)
at org.jboss.aop.SuperClassesFirstWeavingStrategy.translate(SuperClassesFirstWeavingStrategy.java:69)
at org.jboss.aop.AspectManager.translate(AspectManager.java:1071)
at org.jboss.aop.AspectManager.transform(AspectManager.java:1015)
at org.jboss.aop.standalone.AOPTransformer.aspectTransform(AOPTransformer.java:87)
at org.jboss.aop.standalone.AOPTransformer.transform(AOPTransformer.java:75)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at my.package.MyClass.<clinit>(MyClass.java:39)
...
Caused by: compile error: getDomainName(java.lang.Class,boolean) not found in org.jboss.aop.Domain
at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:241)
at javassist.compiler.CodeGen.atDeclarator(CodeGen.java:725)
at javassist.compiler.ast.Declarator.accept(Declarator.java:99)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:291)
at javassist.compiler.Javac.compileBody(Javac.java:222)
at javassist.CtBehavior.setBody(CtBehavior.java:360)
I don't have a clue what to do with this and would be really happy to get some hints.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/530222#530222
16 years, 1 month
[JBoss Microcontainer Development] New message: "Re: Circular Dependencies and Semi-Resolve"
by Adrian Brock
User development,
A new message was posted in the thread "Circular Dependencies and Semi-Resolve":
http://community.jboss.org/message/530211#530211
Author : Adrian Brock
Profile : http://community.jboss.org/people/adrian@jboss.org
Message:
--------------------------------------------------------------
> alesj wrote:
>
> Does this work out-of-the-box for multiple circular depending deployments (aka OSGi bundles, which is what we're aiming for)?
>
> How are service's invalid configs reported -- A on B in ctor, and vice-versa?
> I guess they just don't ever get resolved -- failing at check complete?
Look at the tests, e.g. testTransientComplicatedCircular(), or write a new one if you think its not handled. ;-)
I don't think I've got full coverage on the tests since there's a lot of edge-cases with the
backwards compability handling, but I've got all of the basics.
Circular dependencies will only work if the DependencyItem explicitly invokes semiResolve()
(or it has some other way of handling it). So it doesn't change anything for existing implementations.
The checkComplete() should work fine. If the circular dependency can be resolved, its DependencyItem will
be in the RESOLVED state, so it won't appear in the IncompleteDeploymentException (IDE).
If its only in the SEMI_RESOLVED state, i.e. something is missing, it will appear in the IDE.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/530211#530211
16 years, 1 month