CDV ❯ NPE in aspectwerkz on AsmFieldInfo.getAnnotations()
-
Bug
-
Status: Closed
-
1 Critical
-
Resolution: Fixed
-
DSO:L1
-
-
hsingh
-
Reporter: amiller
-
April 07, 2009
-
0
-
Watchers: 0
-
February 12, 2013
-
April 13, 2009
Description
All from Tim:
Jetty-6.1.11 doesn’t look like it is friendly with tim-jetty-1.2.0 (the version we released with TC 3.0) so I stepped up to 6.1.15 of jetty to test examinator.
Unfortunately it looks like something else is busted….I think it has something to do with annotation matching (as opposed to anything with tim-jetty). Examinator with tomcat seems fine tho
Digging into it I feel this is yet one more bug in Aspectwerkz. It’s a bit involved and one of our earlier fixes to cut down the number of “AW::WARNING” messages is partially to blame.
I don’t think it would be hard to apply another “fix” here, though it would be change in the core TC code. We could maybe workaround it in examinator if sl4j was getting into the examinator.war, but I can’t say until I try it. Adding more libraries in jetty’s classpath might work too.
[WARNING] [cargo1] java.lang.NullPointerException
[WARNING] [cargo1] at com.tc.aspectwerkz.reflect.impl.asm.AsmFieldInfo.getAnnotations(AsmFieldInfo.java:96)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAttributes(ExpressionVisitor.java:815)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAnnotatedNode(ExpressionVisitor.java:1021)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:171)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ast.ASTGet.jjtAccept(ASTGet.java:22)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:100)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:88)
[WARNING] [cargo1] at com.tc.aspectwerkz.expression.ExpressionVisitor.match(ExpressionVisitor.java:74)
[WARNING] [cargo1] at com.tc.object.config.Root.matches(Root.java:94)
[WARNING] [cargo1] at com.tc.object.config.StandardDSOClientConfigHelperImpl.findMatchingRootDefinition(StandardDSOClientConfigHelperImpl.java:980)
[WARNING] [cargo1] at com.tc.object.config.StandardDSOClientConfigHelperImpl.classContainsAnyRoots(StandardDSOClientConfigHelperImpl.java:988)
[WARNING] [cargo1] at com.tc.object.config.StandardDSOClientConfigHelperImpl.shouldBeAdapted(StandardDSOClientConfigHelperImpl.java:1218)
[WARNING] [cargo1] at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transformInternal(DefaultWeavingStrategy.java:164)
[WARNING] [cargo1] at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transform(DefaultWeavingStrategy.java:124)
[WARNING] [cargo1] at com.tc.object.bytecode.hook.impl.DSOContextImpl.preProcess(DSOContextImpl.java:168)
[WARNING] [cargo1] at com.tc.object.bytecode.hook.impl.ClassProcessorHelper.defineClass0Pre(ClassProcessorHelper.java:665)
[WARNING] [cargo1] at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
[WARNING] [cargo1] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
[WARNING] [cargo1] at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
[WARNING] [cargo1] at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
[WARNING] [cargo1] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[WARNING] [cargo1] at java.security.AccessController.doPrivileged(Native Method)
[WARNING] [cargo1] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[WARNING] [cargo1] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:392)
[WARNING] [cargo1] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
[WARNING] [cargo1] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
[WARNING] [cargo1] at org.slf4j.impl.StaticLoggerBinder.
Comments
Alex Miller 2009-04-07
Fiona OShea 2009-04-08
happens if you use Jetty > 6.1.11 and slf4j, workaround = add the jar to jetty libs
Fiona OShea 2009-04-10
Is this resolved for 3.0.0?
Alex Miller 2009-04-13
No, it is not. It was discovered after the kit was created so we couldn’t actually fix it. In 3.0, we did the slf4j lib dance to avoid triggering the problem. Tim has fixed it in 3.0.1 already. I’m not sure how to mark / assign it.
Himadri Singh 2009-05-22
- Checked out tc-3.0 branch of examinator
- Used 1.3.0 version of tc-maven-plugin which uses terracotta 3.0.0
- Modified version of tim-jetty in tc-config.xml to tim-jetty-6.1-1.2.0
- tc-3.0 branch uses jetty 6.1.15
- Ran mvn clean tc:run
- Received the exception
[WARNING] [cargo0] 2009-05-21 22:27:13.135::WARN: Nested in java.lang.ExceptionInInitializerError:
[WARNING] [cargo0] java.lang.NullPointerException
[WARNING] [cargo0] at com.tc.aspectwerkz.reflect.impl.asm.AsmFieldInfo.getAnnotations(AsmFieldInfo.java:96)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAttributes(ExpressionVisitor.java:815)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAnnotatedNode(ExpressionVisitor.java:1021)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:171)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ast.ASTGet.jjtAccept(ASTGet.java:22)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:100)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:88)
[WARNING] [cargo0] at com.tc.aspectwerkz.expression.ExpressionVisitor.match(ExpressionVisitor.java:74)
[WARNING] [cargo0] at com.tc.object.config.Root.matches(Root.java:94)
[WARNING] [cargo0] at com.tc.object.config.StandardDSOClientConfigHelperImpl.findMatchingRootDefinition(StandardDSOClientConfigHelperImpl.java:980)
[WARNING] [cargo0] at com.tc.object.config.StandardDSOClientConfigHelperImpl.classContainsAnyRoots(StandardDSOClientConfigHelperImpl.java:988)
[WARNING] [cargo0] at com.tc.object.config.StandardDSOClientConfigHelperImpl.shouldBeAdapted(StandardDSOClientConfigHelperImpl.java:1218)
[WARNING] [cargo0] at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transformInternal(DefaultWeavingStrategy.java:164)
[WARNING] [cargo0] at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transform(DefaultWeavingStrategy.java:124)
[WARNING] [cargo0] at com.tc.object.bytecode.hook.impl.DSOContextImpl.preProcess(DSOContextImpl.java:168)
[WARNING] [cargo0] at com.tc.object.bytecode.hook.impl.ClassProcessorHelper.defineClass0Pre(ClassProcessorHelper.java:665)
[WARNING] [cargo0] at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
[WARNING] [cargo0] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
[WARNING] [cargo0] at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
[WARNING] [cargo0] at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
[WARNING] [cargo0] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[WARNING] [cargo0] at java.security.AccessController.doPrivileged(Native Method)
[WARNING] [cargo0] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[WARNING] [cargo0] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:392)
[WARNING] [cargo0] at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
[WARNING] [cargo0] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
[WARNING] [cargo0] at org.slf4j.impl.StaticLoggerBinder.
- Used 1.3.1 version of tc-maven-plugin which uses terracotta 3.0.1
- Modified version of tim-jetty in tc-config.xml to tim-jetty-6.1-1.3.0
- tc-3.0 branch uses jetty 6.1.15
- Ran mvn clean tc:run
- Ran fine without any exceptions
Verified in version 2009-05-21 22:36:09,982 INFO - Terracotta 3.0.1, as of 20090514-130526 (Revision 12704 by cruise@su10mo5 from 3.0)
DO NOT want to make changes that would cause a re-kit for 3.0. Tim is looking into other possible options for things we can change in Examinator to fix that before release. Another possible option would be to NOT release a 3.0 version of Examinator, fix the AW problem in 3.0.1 and re-release Examinator then.