Jboss AS7 and Resteasy 3.0.6 fianl(or other version) Integration(java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingClientConnectionManager )
vv_student Jul 12, 2014 12:50 AMHow to solve the problem:
reason: the jboss modules {you jboss home}\modules\org\apache\httpcomponents\main\module.xml
the jboss component the jar is old or not suitable for resteasy.
resteasy need 4.2.1.jar.
so the resolution is : we upgrade the module. copy the 4.2.1 jars and modify the xml.
<module xmlns="urn:jboss:module:1.1" name="org.apache.httpcomponents">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="httpclient-4.1.2.jar"/>
<resource-root path="httpcore-4.1.4.jar"/>
<resource-root path="httpmime-4.1.2.jar"/>
<resource-root path="httpclient-4.2.1.jar"> <resource-root path="httpcore-4.2.1.jar"> <resource-root path="httpmime-4.2.1.jar">
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.apache.commons.codec"/>
<module name="org.apache.commons.logging"/>
<module name="org.apache.james.mime4j"/>
</dependencies>
</module>
12:37:45,629 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Context [/myproject] startup failed due to previous errors: java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingClientConnectionManager
at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.initDefaultEngine(ResteasyClientBuilder.java:428) [resteasy-client-3.0.6.Final.jar:]
at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.build(ResteasyClientBuilder.java:333) [resteasy-client-3.0.6.Final.jar:]
at org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.init(OAuthManagedResourceValve.java:115) [skeleton-key-as7-3.0.6.Final.jar:]
at org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.lifecycleEvent(OAuthManagedResourceValve.java:66) [skeleton-key-as7-3.0.6.Final.jar:]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3845) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
Caused by: java.lang.ClassNotFoundException: org.apache.http.impl.conn.PoolingClientConnectionManager from [Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @129458ea (roots: D:\workspace\myproject\jboss-as-7.1.1.Final\modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 12 more