Unable to configure jsr356 at that stage. ServerContainer is null
anuraggupta opened this issue · 0 comments
Hey guys,
I'm getting this error while starting my application.
My current configuration
- Tomcat 8.0.35
- Application: CXF + Spring + Atmosphere (CXF servlet is configured to boot spring and a CXF JAXRS Server is configured to use websocket transport which in turn invokes Atmosphere Framework)
- Atmosphere 2.4.9
I have tried suppressing JSR356 detection by adding the following init param to CXF servlet
servletRegistration.setInitParameter("org.atmosphere.websocket.suppressJSR356", "true");
The above didn't worked as a VoidServletConfig is created instead of using the CXF one.
Stacktrace:-
[INFO] [talledLocalContainer] [local] [] [DEBUG] [2017-03-15T16:48:45,184] [ocalhost-startStop-1] [pr.DefaultAsyncSupportResolver] Found javax.servlet.AsyncListener
[INFO] [talledLocalContainer] [local] [] [DEBUG] [2017-03-15T16:48:45,185] [ocalhost-startStop-1] [pr.DefaultAsyncSupportResolver] Found javax.websocket.Endpoint
[INFO] [talledLocalContainer] [local] [] [ WARN] [2017-03-15T16:48:45,191] [ocalhost-startStop-1] [pr.DefaultAsyncSupportResolver] Failed to create AsyncSupport class: class org.atmosphere.container.JSR356AsyncSupport, error: java.lang.reflect.InvocationTargetException
[INFO] [talledLocalContainer] [local] [] [ERROR] [2017-03-15T16:48:45,192] [ocalhost-startStop-1] [pr.DefaultAsyncSupportResolver] Real error: Unable to configure jsr356 at that stage. ServerContainer is null
[INFO] [talledLocalContainer] java.lang.IllegalStateException: Unable to configure jsr356 at that stage. ServerContainer is null
[INFO] [talledLocalContainer] at org.atmosphere.container.JSR356AsyncSupport.(JSR356AsyncSupport.java:51) ~[atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at org.atmosphere.container.JSR356AsyncSupport.(JSR356AsyncSupport.java:40) ~[atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:235) [atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:306) [atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:292) [atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:2083) [atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:914) [atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:825) [atmosphere-runtime-2.4.9.jar:2.4.9]
[INFO] [talledLocalContainer] at org.apache.cxf.transport.websocket.atmosphere.AtmosphereWebSocketServletDestination.(AtmosphereWebSocketServletDestination.java:65) [cxf-rt-transports-websocket-3.1.7.jar:3.1.7]
[INFO] [talledLocalContainer] at org.apache.cxf.transport.websocket.WebSocketDestinationFactory.createDestination(WebSocketDestinationFactory.java:96) [cxf-rt-transports-websocket-3.1.7.jar:3.1.7]
[INFO] [talledLocalContainer] at org.apache.cxf.transport.websocket.WebSocketTransportFactory.getDestination(WebSocketTransportFactory.java:136) [cxf-rt-transports-websocket-3.1.7.jar:3.1.7]
[INFO] [talledLocalContainer] at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:84) [cxf-core-3.1.7.jar:3.1.7]
[INFO] [talledLocalContainer] at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:63) [cxf-core-3.1.7.jar:3.1.7]
[INFO] [talledLocalContainer] at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:170) [cxf-rt-frontend-jaxrs-3.1.7.jar:3.1.7]
[INFO] [talledLocalContainer] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) [spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_111]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:776) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444) [spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326) [spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4851) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816) [catalina.jar:8.0.41]
[INFO] [talledLocalContainer] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_111]
[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111]
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
[INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
[INFO] [talledLocalContainer] [local] [] [DEBUG] [2017-03-15T16:48:45,203] [ocalhost-startStop-1] [pr.DefaultAsyncSupportResolver] Found org.apache.catalina.comet.CometFilterChain
[INFO] [talledLocalContainer] [local] [] [DEBUG] [2017-03-15T16:48:45,204] [ocalhost-startStop-1] [pr.DefaultAsyncSupportResolver] Found org.apache.coyote.http11.Http11NioProcessor
[INFO] [talledLocalContainer] [local] [] [ WARN] [2017-03-15T16:48:45,208] [ocalhost-startStop-1] [pr.DefaultAsyncSupportResolver] Found multiple containers, please specify which one to use: org.atmosphere.container.Tomcat7CometSupport, org.atmosphere.container.TomcatCometSupport, until you do, Atmosphere will use:class org.atmosphere.container.Tomcat7CometSupport
[INFO] [talledLocalContainer] [local] [] [ INFO] [2017-03-15T16:48:45,209] [ocalhost-startStop-1] [sphere.cpr.AtmosphereFramework] Installing Default AtmosphereInterceptors
If I deploy the same application on Jetty 8/9 it works perfectly.