Deployment of JBPM as a WAR/EAR in JBoss 7 – java.lang.ClassNotFoundException: com.ning.http.client.providers.netty.NettyAsyncHttpProvider

While deploying the jbpm-examples-rewards-jsf application in JBoss AS 7.1.1 I faced the following problem:

14:05:11,489 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".component.ProcessBean.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".component.ProcessBean.START: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_20]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_20]
	at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_20]
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
	at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
	at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
	at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:116)
	at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:130)
	at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
	... 3 more
Caused by: javax.ejb.EJBException: javax.enterprise.inject.CreationException
	at org.jboss.as.ejb3.tx.BMTInterceptor.handleException(BMTInterceptor.java:78)
	at org.jboss.as.ejb3.tx.EjbBMTInterceptor.checkStatelessDone(EjbBMTInterceptor.java:93)
	at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:108)
	at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:56)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
	... 9 more
Caused by: javax.enterprise.inject.CreationException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_20]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0_20]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0_20]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0_20]
	at java.lang.Class.newInstance0(Class.java:355) [rt.jar:1.6.0_20]
	at java.lang.Class.newInstance(Class.java:308) [rt.jar:1.6.0_20]
	at org.jboss.weld.util.reflection.SecureReflections$16.work(SecureReflections.java:343)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInstantiation(SecureReflectionAccess.java:173)
	at org.jboss.weld.util.reflection.SecureReflections.newInstance(SecureReflections.java:340)
	at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:33)
	at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:45)
	at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:85)
	at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:143)
	at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:133)
	at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:299)
	at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:643)
	at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:102)
	at org.jbpm.runtime.manager.impl.cdi.RuntimeManagerProducer.newSingletonRuntimeManager(RuntimeManagerProducer.java:66)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_20]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_20]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_20]
	at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_20]
	at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
	at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
	at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
	at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)
	at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:137)
	at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:133)
	at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:299)
	at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:681)
	at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:118)
	at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:703)
	at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:712)
	at org.jboss.weld.bean.SessionBean$1$1.proceed(SessionBean.java:176)
	at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
	at org.jboss.weld.bean.SessionBean$1.inject(SessionBean.java:173)
	at org.jboss.as.weld.injection.WeldEEInjection.inject(WeldEEInjection.java:78)
	at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:60)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
	at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:105)
	... 17 more
Caused by: java.lang.NoClassDefFoundError: com/ning/http/client/providers/netty/NettyAsyncHttpProvider
	at org.sonatype.maven.wagon.AhcWagon.openConnectionInternal(AhcWagon.java:150)
	at org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:116)
	at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:218)
	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.connectWagon(WagonRepositoryConnector.java:345)
	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.pollWagon(WagonRepositoryConnector.java:385)
	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:571)
	at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
	... 3 more
Caused by: java.lang.ClassNotFoundException: com.ning.http.client.providers.netty.NettyAsyncHttpProvider from [Module "deployment.rewards-jsf-6.0.1-SNAPSHOT.war:main" from Service Module Loader]
	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
	... 10 more

To solve this problem, I included the jbossclient.jar in the WAR-file.

Short URL for this post: http://wp.me/p4nxik-2iV
This entry was posted in Java EE, Java Runtimes - VM, Appserver & Cloud and tagged , , . Bookmark the permalink.

Leave a Reply