我向New Relic提交了一份支持请求,但我想我也在这里试一试。我正在尝试在wildfly-8.0.0.Beta1中部署我的webpp并获得一个奇怪的Duplicate Annotation异常。我的应用程序在没有New Relic的情况下正常部署,但在完成安装步骤后,我在Weld部署阶段得到了这个堆栈跟踪。
使用JD-GUI,我打开了jar,并且没有在他们引用的类上看到欺骗性注释。
有没有人见过这个?解决的想法?
stacktrace的关键部分是(我认为)这部分:
Caused by: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface com.newrelic.agent.instrumentation.InstrumentedMethod: @com.newrelic.agent.instrumentation.InstrumentedMethod(dispatcher=false, instrumentationType=BuiltIn, instrumentationName=com.newrelic.agent.instrumentation.webservices.RestAnnotationVisitor)
完整的堆栈跟踪:
17:17:40,140 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."crs-http-json-api.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."crs-http-json-api.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1900) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface com.newrelic.agent.instrumentation.InstrumentedMethod: @com.newrelic.agent.instrumentation.InstrumentedMethod(dispatcher=false, instrumentationType=BuiltIn, instrumentationName=com.newrelic.agent.instrumentation.webservices.RestAnnotationVisitor)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2256)
at com.google.common.cache.LocalCache.get(LocalCache.java:3990)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3994)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4878)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:80)
at org.jboss.weld.resources.ClassTransformer.getEnhancedAnnotatedType(ClassTransformer.java:247)
at org.jboss.weld.resources.ClassTransformer.getEnhancedAnnotatedType(ClassTransformer.java:228)
at org.jboss.weld.injection.producer.SubclassedComponentInstantiator.initEnhancedSubclass(SubclassedComponentInstantiator.java:65)
at org.jboss.weld.injection.producer.SubclassedComponentInstantiator.<init>(SubclassedComponentInstantiator.java:58)
at org.jboss.weld.injection.producer.SubclassedComponentInstantiator.<init>(SubclassedComponentInstantiator.java:54)
at org.jboss.weld.injection.producer.BeanInjectionTarget.initializeAfterBeanDiscovery(BeanInjectionTarget.java:127)
at org.jboss.weld.injection.producer.InjectionTargetInitializationContext.initialize(InjectionTargetInitializationContext.java:42)
at org.jboss.weld.injection.producer.InjectionTargetService.initialize(InjectionTargetService.java:58)
at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:410)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:76)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1944) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1877) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]
... 3 more
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface com.newrelic.agent.instrumentation.InstrumentedMethod: @com.newrelic.agent.instrumentation.InstrumentedMethod(dispatcher=false, instrumentationType=BuiltIn, instrumentationName=com.newrelic.agent.instrumentation.webservices.RestAnnotationVisitor)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2256)
at com.google.common.cache.LocalCache.get(LocalCache.java:3990)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3994)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4878)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52)
at org.jboss.weld.resources.DefaultReflectionCache.getAnnotationSet(DefaultReflectionCache.java:136)
at org.jboss.weld.annotated.slim.backed.BackedAnnotated.getAnnotations(BackedAnnotated.java:36)
at org.jboss.weld.annotated.enhanced.jlr.EnhancedAnnotatedMethodImpl.of(EnhancedAnnotatedMethodImpl.java:62)
at org.jboss.weld.annotated.enhanced.jlr.EnhancedAnnotatedTypeImpl.<init>(EnhancedAnnotatedTypeImpl.java:222)
at org.jboss.weld.annotated.enhanced.jlr.EnhancedAnnotatedTypeImpl.of(EnhancedAnnotatedTypeImpl.java:130)
at org.jboss.weld.resources.ClassTransformer$TransformSlimAnnotatedTypeToEnhancedAnnotatedType.load(ClassTransformer.java:93)
at org.jboss.weld.resources.ClassTransformer$TransformSlimAnnotatedTypeToEnhancedAnnotatedType.load(ClassTransformer.java:89)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252)
... 21 more
Caused by: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface com.newrelic.agent.instrumentation.InstrumentedMethod: @com.newrelic.agent.instrumentation.InstrumentedMethod(dispatcher=false, instrumentationType=BuiltIn, instrumentationName=com.newrelic.agent.instrumentation.webservices.RestAnnotationVisitor)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:94) [rt.jar:1.7.0_25]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) [rt.jar:1.7.0_25]
at java.lang.reflect.Method.declaredAnnotations(Method.java:714) [rt.jar:1.7.0_25]
at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:707) [rt.jar:1.7.0_25]
at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:196) [rt.jar:1.7.0_25]
at org.jboss.weld.resources.HotspotReflectionCache.internalGetAnnotations(HotspotReflectionCache.java:58)
at org.jboss.weld.resources.DefaultReflectionCache$1.load(DefaultReflectionCache.java:81)
at org.jboss.weld.resources.DefaultReflectionCache$1.load(DefaultReflectionCache.java:78)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252)
... 36 more
17:17:40,164 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "crs-http-json-api.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"crs-http-json-api.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"crs-http-json-api.war\".WeldStartService: Failed to start service
Caused by: com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface com.newrelic.agent.instrumentation.InstrumentedMethod: @com.newrelic.agent.instrumentation.InstrumentedMethod(dispatcher=false, instrumentationType=BuiltIn, instrumentationName=com.newrelic.agent.instrumentation.webservices.RestAnnotationVisitor)
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface com.newrelic.agent.instrumentation.InstrumentedMethod: @com.newrelic.agent.instrumentation.InstrumentedMethod(dispatcher=false, instrumentationType=BuiltIn, instrumentationName=com.newrelic.agent.instrumentation.webservices.RestAnnotationVisitor)
Caused by: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface com.newrelic.agent.instrumentation.InstrumentedMethod: @com.newrelic.agent.instrumentation.InstrumentedMethod(dispatcher=false, instrumentationType=BuiltIn, instrumentationName=com.newrelic.agent.instrumentation.webservices.RestAnnotationVisitor)"}}
答案 0 :(得分:0)
我们遇到了同样的问题。这是与javax.annotation.security的版本冲突。 例如,在新的relic代理中使用了旧版本的@DenyAll。 幸运的是,这是修复新的遗物3.3.2