2 Replies Latest reply on Mar 28, 2014 2:21 PM by Richard Yang

    How to know which class is causing AnnotationFormatError: Duplicate annotation for class: interface javax.inject.Inject: @javax.inject.Inject()

    Richard Yang Apprentice

      I got this error (stack trace below). But I could not figure out which class(es) is causing this. Is this from our own injection code or from third party or from the container itself. I tried to turn on the debug level log, but still could not see. Could you help me?

      Thanks.

       

       

       

      2014-03-28 10:03:13,376 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC000001: Failed to start service jboss.deployment.unit."epen-account-setup.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."epen-account-setup.war".WeldStartService: Failed to start service

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]

      Caused by: org.jboss.weld.exceptions.DeploymentException: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface javax.inject.Inject: @javax.inject.Inject()

          at org.jboss.weld.executor.AbstractExecutorServices.checkForExceptions(AbstractExecutorServices.java:66)

          at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:43)

          at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:51)

          at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.createClassBeans(ConcurrentBeanDeployer.java:72)

          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:260)

          at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:351)

          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:79)

          at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:92)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]

          ... 3 more

      Caused by: com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface javax.inject.Inject: @javax.inject.Inject()

          at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199)

          at com.google.common.cache.LocalCache.get(LocalCache.java:3934)

          at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)

          at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)

          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.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:237)

          at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:74)

          at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:72)

          at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)

          at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0]

          at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0]

          ... 3 more

      Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface javax.inject.Inject: @javax.inject.Inject()

          at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199)

          at com.google.common.cache.LocalCache.get(LocalCache.java:3934)

          at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)

          at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)

          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.EnhancedAnnotatedFieldImpl.of(EnhancedAnnotatedFieldImpl.java:45)

          at org.jboss.weld.annotated.enhanced.jlr.EnhancedAnnotatedTypeImpl.<init>(EnhancedAnnotatedTypeImpl.java:164)

          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:3524)

          at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)

          at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)

          at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)

          ... 16 more

      Caused by: java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface javax.inject.Inject: @javax.inject.Inject()

          at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:94) [rt.jar:1.7.0]

          at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) [rt.jar:1.7.0]

          at java.lang.reflect.Field.declaredAnnotations(Field.java:1033) [rt.jar:1.7.0]

          at java.lang.reflect.Field.getDeclaredAnnotations(Field.java:1026) [rt.jar:1.7.0]

          at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:196) [rt.jar:1.7.0]

          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:3524)

          at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)

          at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)

          at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)

          ... 31 more