0 Replies Latest reply on Mar 28, 2016 10:01 AM by Andrei Ivanov

    Apache http classes not found

    Andrei Ivanov Newbie

      Hello,

      I'm trying to deploy a simple JAX-RS app on a WildFly 10 instance but I get this error:

      DEBUG [org.jboss.weld.Bootstrap] (Weld Thread Pool -- 2) Catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class siteaccess.web.backend.service.RestEasyClientProducer
          at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:186)
          at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)
          at org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.loadAnnotatedType(FastAnnotatedTypeLoader.java:113)
          at org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.createContext(FastAnnotatedTypeLoader.java:102)
          at org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.loadAnnotatedType(FastAnnotatedTypeLoader.java:91)
          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:97)
          at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:65)
          at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62)
          at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
          at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
          at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.NoClassDefFoundError: org/apache/http/conn/socket/LayeredConnectionSocketFactory
          at java.lang.Class.getDeclaredConstructors0(Native Method)
          at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
          at java.lang.Class.getDeclaredConstructors(Class.java:2020)
          at org.jboss.weld.annotated.slim.backed.SecurityActions.getDeclaredConstructors(SecurityActions.java:57)
          at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedConstructors.computeValue(BackedAnnotatedType.java:163)
          at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedConstructors.computeValue(BackedAnnotatedType.java:160)
          at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:35)
          at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.<init>(BackedAnnotatedType.java:156)
          at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedConstructors.<init>(BackedAnnotatedType.java:160)
          at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedConstructors.<init>(BackedAnnotatedType.java:160)
          at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.<init>(BackedAnnotatedType.java:61)
          at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:44)
          at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:83)
          at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:80)
          at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
          at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
          at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
          at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
          at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
          at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
          at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
          at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:49)
          at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:74)
          at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:175)
          ... 14 more
      Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.socket.LayeredConnectionSocketFactory from [Module "deployment.siteaccess-backend.war:main" from Service Module Loader]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
          ... 38 more
      
      

      As far as I see, wildfly-10.0.0.Final\modules\system\layers\base\org\apache\httpcomponents\main\httpclient-4.5.jar contains the org.apache.http.conn.socket.LayeredConnectionSocketFactory class.

       

      I've tried upgrading all the httpcomponents jars to the latest versions, but now I get another exception:

      Caused by: java.lang.ClassNotFoundException: org.apache.http.protocol.HttpContext from [Module "deployment.siteaccess-backend.war:main" from Service Module Loader]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
          ... 38 more
      
      

      This class is present in httpcore-4.4.4.jar.

       

      Can anybody enlighten me please?