Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2634

Classloading Problem with Apache httpclient

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 8.0.0.Beta1
    • Fix Version/s: 8.0.0.Final
    • Component/s: REST
    • Labels:
      None

      Description

      I have a Deployment of Type WAR which includes Apache httpclient-4.3.1
      which i use to communicate to other web site for Example finance.yahoo.com.
      My Deployment includes JAX-RS Rest Services, if i deploy the WAR to JBoss-7.2.0 everything works fine. If i deploy it to Wildfly-8.0.0.Beta1 i got the following error.

      10:32:54,545 ERROR [org.jboss.as.ejb3] (ServerService Thread Pool -- 53) javax.ejb.EJBTransactionRolledbackException: Unexpected Error
      10:32:54,555 ERROR [org.jboss.as.ejb3.invocation] (ServerService Thread Pool -- 53) JBAS014134: EJB Invocation failed on component TransactionEJB for method public java.lang.Object com.citc.ewallet.tx.TransactionEJB.executeWithin(com.citc.ewallet.tx.TXWork): javax.ejb.EJBTransactionRolledbackException: Unexpected Error
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:157) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:253) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:342) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:325)
      	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:437)
      	at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:325)
      	at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      	at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
      	at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      	at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
      	at com.citc.ewallet.tx.TransactionEJB$$$view2.executeWithin(Unknown Source) [classes:]
      	at com.citc.ewallet.exchange.ExchangeService.processExchangeRates(ExchangeService.java:80) [classes:]
      	at com.citc.ewallet.exchange.ExchangeService.init(ExchangeService.java:57) [classes:]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]
      	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]
      	at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:165) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:148) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:406)
      	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55) [weld-core-impl-2.1.0.Beta2.jar:2013-09-14 18:00]
      	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:84) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:56) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:115)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:62) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:369) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:325)
      	at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      	at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:160)
      	at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:84)
      	at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:126) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:141) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_21]
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_21]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
      	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
      	at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: java.lang.NoSuchFieldError: INSTANCE
      	at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52) [httpcore-4.3.jar:4.3]
      	at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56) [httpcore-4.3.jar:4.3]
      	at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46) [httpcore-4.3.jar:4.3]
      	at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:487) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:147) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:136) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:112) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:727) [httpclient-4.3.1.jar:4.3.1]
      	at org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:58) [httpclient-4.3.1.jar:4.3.1]
      	at com.citc.ewallet.exchange.ExchangeService.processRates(ExchangeService.java:105) [classes:]
      	at com.citc.ewallet.exchange.ExchangeService$1.doVoidWork(ExchangeService.java:83) [classes:]
      	at com.citc.ewallet.tx.TXVoidWork.doWork(TXVoidWork.java:6) [classes:]
      	at com.citc.ewallet.tx.TransactionEJB.executeWithin(TransactionEJB.java:21) [classes:]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]
      	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]
      	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
      	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:406)
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:130) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:138) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
      	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:406)
      	at org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:104) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:406)
      	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46) [weld-core-impl-2.1.0.Beta2.jar:2013-09-14 18:00]
      	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:84) [wildfly-weld-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      	at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:52) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:251) [wildfly-ejb3-8.0.0.Beta1-SNAPSHOT.jar:8.0.0.Beta1-SNAPSHOT]
      	... 88 more
      

      After some research i found out that JBoss-7.2.0 and Wildfly-8.0.0.Beta1 both are using httpclient-4.2.1, which are loaded through resteasy from the server modules.
      I tried to exclude the server module "org.apache.httpcomponents" with a jboss-deployment-structure.xml but got no success. It seems that something changed with the classloading of the implicit modules in Wildfly

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swd847 Stuart Douglas
                Reporter:
                ercano Ercan Oezkan
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: