1 Reply Latest reply on Mar 17, 2016 11:06 AM by Tomaz Cerar

    NoClassDefFoundError: com/sun/net/httpserver/HttpHandler on WildFly 9.0.2

    Zappee Zappee Newbie

      Hi,

       

      I got a ClassNotFoundException: com.sun.net.httpserver.HttpHandler exception during deploying ear on Wildfly 9.0.2 server.

       

      Do you have any idea what can be the solution? Ho I can enable httpserver module on WildFly 9.0.2?

       

      2016-03-16 23:20:09,034 INFO  [com.abc.mydemo.service.user.Bootstrap] (ServerService Thread Pool -- 73) Initializing User Camel Routes.

      2016-03-16 23:20:09,049 INFO  [org.apache.camel.cdi.CdiCamelContext] (ServerService Thread Pool -- 73) Apache Camel 2.16.1 (CamelContext: camel-2) is starting

      2016-03-16 23:20:09,050 INFO  [org.apache.camel.management.ManagedManagementStrategy] (ServerService Thread Pool -- 73) JMX is enabled

      2016-03-16 23:20:09,266 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (ServerService Thread Pool -- 73) Loaded 189 type converters

      2016-03-16 23:20:09,314 INFO  [org.apache.camel.impl.DefaultRuntimeEndpointRegistry] (ServerService Thread Pool -- 73) Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)

      2016-03-16 23:20:09,320 INFO  [org.apache.camel.cdi.CdiCamelContext] (ServerService Thread Pool -- 73) AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.

      2016-03-16 23:20:09,320 INFO  [org.apache.camel.cdi.CdiCamelContext] (ServerService Thread Pool -- 73) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html

      2016-03-16 23:20:09,320 INFO  [org.apache.camel.cdi.CdiCamelContext] (ServerService Thread Pool -- 73) Total 0 routes, of which 0 is started.

      2016-03-16 23:20:09,322 INFO  [org.apache.camel.cdi.CdiCamelContext] (ServerService Thread Pool -- 73) Apache Camel 2.16.1 (CamelContext: camel-2) started in 0.274 seconds

      2016-03-16 23:20:09,909 INFO  [org.apache.camel.cdi.CdiCamelContext] (ServerService Thread Pool -- 73) Route: GET@statuss started and consuming from: Endpoint[direct://GET@api/user]

      2016-03-16 23:20:10,128 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 73) MSC000001: Failed to start service jboss.deployment.subunit."mydemo-0.0.0.ear"."mydemo-user-service-0.0.0.jar".component.Bootstrap.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."mydemo-0.0.0.ear"."mydemo-user-service-0.0.0.jar".component.Bootstrap.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

              at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_74]

              at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_74]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_74]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_74]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_74]

              at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:122)

              at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:136)

              at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              ... 6 more

      Caused by: javax.ejb.EJBException: WFLYEJB0442: Unexpected Error

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:184)

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:349)

              at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              ... 11 more

      Caused by: java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler

              at org.restlet.engine.Engine.registerDefaultConnectors(Engine.java:730)

              at org.restlet.engine.Engine.discoverConnectors(Engine.java:546)

              at org.restlet.engine.Engine.<init>(Engine.java:379)

              at org.restlet.engine.Engine.register(Engine.java:301)

              at org.restlet.engine.Engine.register(Engine.java:290)

              at org.restlet.engine.Engine.getInstance(Engine.java:199)

              at org.restlet.Restlet.<init>(Restlet.java:122)

              at org.restlet.Restlet.<init>(Restlet.java:99)

              at org.restlet.Component.<init>(Component.java:173)

              at org.apache.camel.component.restlet.RestletComponent.<init>(RestletComponent.java:91)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_74]

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_74]

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_74]

              at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [rt.jar:1.8.0_74]

              at java.lang.Class.newInstance(Class.java:442) [rt.jar:1.8.0_74]

              at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:1537)

              at org.apache.camel.util.ReflectionInjector.newInstance(ReflectionInjector.java:32)

              at org.apache.camel.cdi.CdiInjector.newInstance(CdiInjector.java:48)

              at org.apache.camel.impl.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:87)

              at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:401)

              at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:388)

              at org.apache.camel.component.rest.RestEndpoint.createConsumer(RestEndpoint.java:213)

              at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:68)

              at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:98)

              at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)

              at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3453)

              at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3383)

              at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3405)

              at org.apache.camel.impl.DefaultCamelContext.startRouteService(DefaultCamelContext.java:3282)

              at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:949)

              at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3258)

              at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:881)

              at org.apache.camel.builder.RouteBuilder.populateRoutes(RouteBuilder.java:417)

              at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:330)

              at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:837)

              at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:834)

              at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2831)

              at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:834)

              at org.apache.camel.cdi.CdiCamelContext$Proxy$_$$_WeldClientProxy.addRoutes(Unknown Source)

              at com.abc.mydemo.service.user.Bootstrap.init(Bootstrap.java:33)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_74]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_74]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_74]

              at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_74]

              at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)

              at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)

              at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:100)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [wildfly-ee-9.0.2.Final.jar:9.0.2.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)

              ... 27 more

      Caused by: java.lang.ClassNotFoundException: com.sun.net.httpserver.HttpHandler from [Module "deployment.mydemo-0.0.0.ear:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.4.3.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) [jboss-modules.jar:1.4.3.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) [jboss-modules.jar:1.4.3.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) [jboss-modules.jar:1.4.3.Final]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) [jboss-modules.jar:1.4.3.Final]

              ... 91 more

       

      2016-03-16 23:20:10,145 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-2) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "mydemo-0.0.0.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"mydemo-0.0.0.ear\".\"mydemo-user-service-0.0.0.jar\".component.Bootstrap.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"mydemo-0.0.0.ear\".\"mydemo-user-service-0.0.0.jar\".component.Bootstrap.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: javax.ejb.EJBException: WFLYEJB0442: Unexpected Error

          Caused by: java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler

          Caused by: java.lang.ClassNotFoundException: com.sun.net.httpserver.HttpHandler from [Module \"deployment.mydemo-0.0.0.ear:main\" from Service Module Loader]"}}

      2016-03-16 23:20:10,150 ERROR [org.jboss.as.server] (XNIO-1 task-2) WFLYSRV0021: Deploy of deployment "mydemo-0.0.0.ear" was rolled back with the following failure message:

      {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"mydemo-0.0.0.ear\".\"mydemo-user-service-0.0.0.jar\".component.Bootstrap.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"mydemo-0.0.0.ear\".\"mydemo-user-service-0.0.0.jar\".component.Bootstrap.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: javax.ejb.EJBException: WFLYEJB0442: Unexpected Error

          Caused by: java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler

          Caused by: java.lang.ClassNotFoundException: com.sun.net.httpserver.HttpHandler from [Module \"deployment.mydemo-0.0.0.ear:main\" from Service Module Loader]"}}

      2016-03-16 23:20:10,171 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 73) WFLYUT0022: Unregistered web context: /mydemo-admin-ui