4 Replies Latest reply on Oct 27, 2017 10:20 AM by fbarbe

    [Wildfly 10] org.jboss.classfilewriter.DuplicateMemberException

    fbarbe

      Hi,

       

      We have some troubles with org.jboss.classfilewriter.DuplicateMemberException during some performance tests sessions.

       

      We are on Wildfly 10.1.0 ( with Weld core 2.3.5.Final )

      The performance tests sessions are played with Neoload and survey with Dynatrace.

       

      We found a lot of DuplicateMemberException  that seem to be random.

       

      Here some stacktraces extracted from dynatrace:

       

      session screenshootStack

      Exception Details

      Type:        DuplicateMemberException

      Exception Class:        org.jboss.classfilewriter.DuplicateMemberException

      Message:        Method  already exists. Method: openSession Parameters:[Lcom/lectra/fip/pub/model/interfaces/core/ExecutionContext;, Ljava/lang/String;, Ljava/lang/String;, Ljava/lang/String;] Return Type: Ljava/lang/Long;

      Agent:        JBossREP_INFRA_PERF@srdsbl202:14880

      API:        Exception

      Thread Name:        default task-33 <1228940970>

       

      Exception StackTrace

      Method        Class        Line        File Name

      addMethod        org.jboss.classfilewriter.ClassFile        133        <unknown>

      addMethod        org.jboss.classfilewriter.ClassFile        148        <unknown>

      addMethods        org.jboss.weld.bean.proxy.ProxyFactory        647        <unknown>

      addMethodsFromClass        org.jboss.weld.bean.proxy.ProxyFactory        614        <unknown>

      addMethods        org.jboss.weld.bean.proxy.ProxyFactory        582        <unknown>

      createProxyClass        org.jboss.weld.bean.proxy.ProxyFactory        469        <unknown>

      getProxyClass        org.jboss.weld.bean.proxy.ProxyFactory        364        <unknown>

      run        org.jboss.weld.bean.proxy.ProxyFactory        334        <unknown>

      create        org.jboss.weld.bean.proxy.ProxyFactory        326        <unknown>

      create        org.jboss.weld.bean.proxy.ClientProxyFactory        83        <unknown>

      createClientProxy        org.jboss.weld.bean.proxy.ClientProxyProvider        209        <unknown>

      createClientProxy        org.jboss.weld.bean.proxy.ClientProxyProvider        199        <unknown>

      access$100        org.jboss.weld.bean.proxy.ClientProxyProvider        47        <unknown>

      load        org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy        55        <unknown>

      load        org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy        51        <unknown>

      loadFuture        com.google.common.cache.LocalCache$LoadingValueReference        3527        <unknown>

      loadSync        com.google.common.cache.LocalCache$Segment        2319        <unknown>

      lockedGetOrLoad        com.google.common.cache.LocalCache$Segment        2282        <unknown>

      get        com.google.common.cache.LocalCache$Segment        2197        <unknown>

      get        com.google.common.cache.LocalCache        3937        <unknown>

      getOrLoad        com.google.common.cache.LocalCache        3941        <unknown>

      get        com.google.common.cache.LocalCache$LocalLoadingCache        4824        <unknown>

      getCacheValue        org.jboss.weld.util.cache.LoadingCacheUtils        49        <unknown>

      getCastCacheValue        org.jboss.weld.util.cache.LoadingCacheUtils        74        <unknown>

      getClientProxy        org.jboss.weld.bean.proxy.ClientProxyProvider        233        <unknown>

      getReference        org.jboss.weld.manager.BeanManagerImpl        736        <unknown>

      getInjectableReference        org.jboss.weld.manager.BeanManagerImpl        842        <unknown>

      inject        org.jboss.weld.injection.FieldInjectionPoint        92        <unknown>

      injectBoundFields        org.jboss.weld.util.Beans        364        <unknown>

      injectFieldsAndInitializers        org.jboss.weld.util.Beans        375        <unknown>

      proceed        org.jboss.weld.injection.producer.DefaultInjector$1        71        <unknown>

      run        org.jboss.weld.injection.InjectionContextImpl        48        <unknown>

      inject        org.jboss.weld.injection.producer.DefaultInjector        73        <unknown>

      inject        org.jboss.weld.injection.producer.BasicInjectionTarget        121        <unknown>

      inject        org.jboss.as.weld.injection.WeldInjectionContext        39        <unknown>

      processInvocation        org.jboss.as.weld.injection.WeldInjectionInterceptor        51        <unknown>

      proceed        org.jboss.invocation.InterceptorContext        340        <unknown>

      processInvocation        org.jboss.as.ee.component.AroundConstructInterceptorFactory$1        28        <unknown>

      proceed        org.jboss.invocation.InterceptorContext        340        <unknown>

      processInvocation        org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor        56        <unknown>

      Exception Details

      Type:        DuplicateMemberException

      Exception Class:        org.jboss.classfilewriter.DuplicateMemberException

      Message:        Method  already exists. Method: all Parameters:[Ljava/lang/String;] Return Type: Ljava/util/List;

      Agent:        JBossAPP_INFRA_PERF@srdsbl201:14684

      API:        Exception

      Thread Name:        Thread-3 (ActiveMQ-client-global-threads-1940882939) <1590198085>

       

      Exception StackTrace

      Method        Class        Line        File Name

      addMethod        org.jboss.classfilewriter.ClassFile        133        <unknown>

      addMethod        org.jboss.classfilewriter.ClassFile        148        <unknown>

      addMethodsFromClass        org.jboss.weld.bean.proxy.ProxyFactory        629        <unknown>

      addMethods        org.jboss.weld.bean.proxy.ProxyFactory        582        <unknown>

      createProxyClass        org.jboss.weld.bean.proxy.ProxyFactory        469        <unknown>

      getProxyClass        org.jboss.weld.bean.proxy.ProxyFactory        364        <unknown>

      run        org.jboss.weld.bean.proxy.ProxyFactory        334        <unknown>

      create        org.jboss.weld.bean.proxy.ProxyFactory        326        <unknown>

      create        org.jboss.weld.bean.proxy.ClientProxyFactory        83        <unknown>

      createClientProxy        org.jboss.weld.bean.proxy.ClientProxyProvider        209        <unknown>

      createClientProxy        org.jboss.weld.bean.proxy.ClientProxyProvider        199        <unknown>

      access$100        org.jboss.weld.bean.proxy.ClientProxyProvider        47        <unknown>

      load        org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy        55        <unknown>

      load        org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy        51        <unknown>

      loadFuture        com.google.common.cache.LocalCache$LoadingValueReference        3527        <unknown>

      loadSync        com.google.common.cache.LocalCache$Segment        2319        <unknown>

      lockedGetOrLoad        com.google.common.cache.LocalCache$Segment        2282        <unknown>

      get        com.google.common.cache.LocalCache$Segment        2197        <unknown>

      get        com.google.common.cache.LocalCache        3937        <unknown>

      getOrLoad        com.google.common.cache.LocalCache        3941        <unknown>

      get        com.google.common.cache.LocalCache$LocalLoadingCache        4824        <unknown>

      getCacheValue        org.jboss.weld.util.cache.LoadingCacheUtils        49        <unknown>

      getCastCacheValue        org.jboss.weld.util.cache.LoadingCacheUtils        74        <unknown>

      getClientProxy        org.jboss.weld.bean.proxy.ClientProxyProvider        233        <unknown>

      getReference        org.jboss.weld.manager.BeanManagerImpl        736        <unknown>

      getInjectableReference        org.jboss.weld.manager.BeanManagerImpl        842        <unknown>

      inject        org.jboss.weld.injection.FieldInjectionPoint        92        <unknown>

      injectBoundFields        org.jboss.weld.util.Beans        364        <unknown>

      injectFieldsAndInitializers        org.jboss.weld.util.Beans        375        <unknown>

      proceed        org.jboss.weld.injection.producer.ResourceInjector$1        70        <unknown>

      run        org.jboss.weld.injection.InjectionContextImpl        48        <unknown>

      inject        org.jboss.weld.injection.producer.ResourceInjector        72        <unknown>

      inject        org.jboss.weld.injection.producer.BasicInjectionTarget        121        <unknown>

      create        org.jboss.weld.bean.ManagedBean        159        <unknown>

      get        org.jboss.weld.context.unbound.DependentContextImpl        70        <unknown>

      get        org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy        101        <unknown>

      get        org.jboss.weld.bean.ContextualInstance        50        <unknown>

      getReference        org.jboss.weld.manager.BeanManagerImpl        742        <unknown>

      getInjectableReference        org.jboss.weld.manager.BeanManagerImpl        842        <unknown>

      inject        org.jboss.weld.injection.FieldInjectionPoint        92        <unknown>

       

      We can see that exception raise from any component of the application (http filter, jms listener ...)

       

      Does someone have an idea ?

       

      Thanks

      Regards.

       

      François

        • 1. Re: [Wildfly 10] org.jboss.classfilewriter.DuplicateMemberException
          mkouba

          Hi François,

          those exceptions are expected during proxy class construction, i.e. if a bean class happens to be part of a non-trivial class hierarchy. However, you should not see those exceptions once the proxy class is constructred. What does it exactly mean "we found a lot of DuplicateMemberException"? Do those exceptions cause a significant drop in performance? If so, I would recommend some kind "application warmup" (similar to JVM warmup) before you start measuring.

          • 2. Re: [Wildfly 10] org.jboss.classfilewriter.DuplicateMemberException
            fbarbe

            Hi Martin,

             

            Thanks for your reply.

             

            I'm agree with your analyse.

            I have a quick look into the source of weld and I didn't find how the construction a proxy class can add twice the same method.

            That process seems to be thread safe, the instance of proxy class should not be use twice during the construction phase....

             

            An other strange thing is that the DuplicateMemberException are only visibled in live session. We don't have them  in the saved session dynatrace.

            "a lot of DuplicateMemberException" means that the number of occurence of this exception seems to be significative because I succeed to trap them easily during the session.

            But as they aren't saved, so I don't have a quantitative number to compare to other. (And I don't retreive them in my application logs)

             

            Yes, we do a warmup before start the real performance measure.

             

            Can this exception be a "normal" exception ?

            I mean the weld treatment of CDI can generate this exception in some nominal case and that don't alterate the whole CDI process ?

             

            Regards

            • 3. Re: [Wildfly 10] org.jboss.classfilewriter.DuplicateMemberException
              mkouba

              I have a quick look into the source of weld and I didn't find how the construction a proxy class can add twice the same method.

              That process seems to be thread safe, the instance of proxy class should not be use twice during the construction phase....

              E.g. https://github.com/weld/core/blob/master/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L644

              Can this exception be a "normal" exception ?

              I mean the weld treatment of CDI can generate this exception in some nominal case and that don't alterate the whole CDI process ?

              I'm not sure I completely understand but Weld ignores those exceptions intentionally. We could probably avoid those exceptions but the question is whether it could even have a significant impact.

              1 of 1 people found this helpful
              • 4. Re: [Wildfly 10] org.jboss.classfilewriter.DuplicateMemberException
                fbarbe

                I missed that catch.

                You're right, it's the normal behaviour of Weld.

                That explains that I have no log of this exception.

                 

                I misinterpreted the data of dynatrace.

                It was a side effect of the fact that dynatrace trap all exceptions during the session.

                But finally, we don't have to care with "DuplicateMemberException"

                 

                many thanks for your help.