java - 在 Wildfly 上使用 New Relic 进行部署时出现异常

标签 java deployment newrelic wildfly

我向 New Relic 提交了支持请求,但我想我也应该在这里尝试一下。我正在尝试在 wildfly-8.0.0.Beta1 中部署我的 webpp 并得到一个奇怪的重复注释异常。我的应用程序在没有 New Relic 的情况下正常部署,但在完成安装步骤后,我在 Weld 部署阶段获得了此堆栈跟踪。

使用 JD-GUI,我打开了 jar,并且在它们引用的类上没有看到重复的注释。

有人见过这个吗?解决问题的想法?

堆栈跟踪的关键部分是(我认为)这部分:

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)"}}

最佳答案

我们也遇到了同样的问题。这是与 javax.annotation.security 的版本冲突。 例如,在新的遗迹代理中使用了旧版本的@DenyAll。 幸运的是,新的遗迹 3.3.2 修复了这个问题

关于java - 在 Wildfly 上使用 New Relic 进行部署时出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20693009/

相关文章:

java - 将 com.google.protobuf.ByteString 转换为字符串

java - javac中-source的使用

linux - ansible ansible_default_ipv4 设置错误的接口(interface)

ruby - Sidekiq 正在提升我在 New Relic 中的性能监控

java - 广播接收器: Why it doesn't work?

java - 如何使用 stackexchange api 交叉检查技术技能(标签)?

java - Java Web 应用程序的无缝重新部署

tomcat - 无法使用maven插件将 war 部署到tomcat

ruby-on-rails - 如何阻止路由错误错误导致各种警告?

android - 任务 ':app:processReleaseGoogleServices' 执行失败。 > 找不到与包名称匹配的客户端