1
votes

Running the default Skeleton Key example with Jboss AS7 and Resteasy, I have followed the directions exactly here: https://github.com/resteasy/Resteasy/tree/master/jaxrs/examples/oauth2-as7-example but still get an error on deploy:

14:35:10,453 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-11) Context [/customer-portal] 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_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: java.lang.ClassNotFoundException: org.apache.http.impl.conn.PoolingClientConnectionManager from [Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @1d1aed21 (roots: /Users/JamesTruty/work/jboss-as-7.1.1.Final oauth/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

I have tried various ways of trying to include the apache httpclient library, but still no luck. Am I missing something?

2

2 Answers

0
votes

A NoClassDefFoundError specifies that the particular library was available during compile time, but missing at runtime. You need to make sure that httpclient jar is present in your classpath. If it is present then it might be having a static initialization failure or is being loaded via a different classloader. You can go through this for any further info on how to debug a NoClassDefFoundError

0
votes

Okay, after more tweaking I got it to successfully deploy the sample app. I needed to update the jar versions and modify the module xml in Jboss to point to org.apache.httpcomponents to use httpclient-4.2.1.jar, httpcore-4.2.1.jar and httpmime-4.2.1.jar.