{"action":"created","issue":{"url":"https://api.github.com/repos/Atmosphere/atmosphere/issues/2213","repository_url":"https://api.github.com/repos/Atmosphere/atmosphere","labels_url":"https://api.github.com/repos/Atmosphere/atmosphere/issues/2213/labels{/name}","comments_url":"https://api.github.com/repos/Atmosphere/atmosphere/issues/2213/comments","events_url":"https://api.github.com/repos/Atmosphere/atmosphere/issues/2213/events","html_url":"https://github.com/Atmosphere/atmosphere/issues/2213","id":177206463,"number":2213,"title":"Jboss EAP 6.4 - JSR356AsyncSupport error: java.lang.IllegalStateException: Unable to configure jsr356 at that stage. ServerContainer is null.","user":{"login":"Quentame","id":14821482,"avatar_url":"https://avatars.githubusercontent.com/u/14821482?v=3","gravatar_id":"","url":"https://api.github.com/users/Quentame","html_url":"https://github.com/Quentame","followers_url":"https://api.github.com/users/Quentame/followers","following_url":"https://api.github.com/users/Quentame/following{/other_user}","gists_url":"https://api.github.com/users/Quentame/gists{/gist_id}","starred_url":"https://api.github.com/users/Quentame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quentame/subscriptions","organizations_url":"https://api.github.com/users/Quentame/orgs","repos_url":"https://api.github.com/users/Quentame/repos","events_url":"https://api.github.com/users/Quentame/events{/privacy}","received_events_url":"https://api.github.com/users/Quentame/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-15T15:19:46Z","updated_at":"2016-11-28T06:28:07Z","closed_at":"2016-10-21T14:04:39Z","body":"Hello !\n\n@stour and I are working on implementing **Atmosphere on JBoss EAP 6.4.5**.\n\nOn our **JEE 6** application, we are using **PrimeFaces 5.2.13** which has simplified implementations of Atmosphere.\n**JDK 1.7**\n**JVM 1.8**\n\nI implemented Atmosphere 2.3.8 and I saw on my console:\n\n```\nWebSocket connection to 'wss://localhost:8443/framework-ui-jsf2-showcase/primepush/tod…ransport=websocket&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 501\nWebsocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent).\nWebsocket closed, wasClean: false\nWebsocket failed. Downgrading to Comet and resending\n```\n\nSo the server \"push\" works but **it is always using Long Polling instead of WebSocket** (tested on Chrome 53 and Firefox 50).\n\nOn the server log, I'v got the famous error \"org.atmosphere.container.JSR356AsyncSupport, error: java.lang.IllegalStateException: **Unable to configure jsr356 at that stage. ServerContainer is null**\":\nWith **Atmosphere 2.3.8** (native or not)\n\n``` java\n14:36:27,333 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 60) Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol \n14:36:27,348 ERROR [org.atmosphere.cpr.DefaultAsyncSupportResolver] (ServerService Thread Pool -- 60) Failed to create AsyncSupport class: class org.atmosphere.container.JSR356AsyncSupport, error: java.lang.reflect.InvocationTargetException\n14:36:27,348 ERROR [org.atmosphere.cpr.DefaultAsyncSupportResolver] (ServerService Thread Pool -- 60) Real error: class org.atmosphere.container.JSR356AsyncSupport, error: java.lang.IllegalStateException: Unable to configure jsr356 at that stage. ServerContainer is null\n14:36:27,348 ERROR [org.atmosphere.cpr.DefaultAsyncSupportResolver] (ServerService Thread Pool -- 60) Switching to BlockingIO\n14:36:27,348 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 60) Installing Default AtmosphereInterceptors\n\n```\n\nWith **Atmosphere 2.4.6** (native or not)\n\n``` java\n15:40:39,255 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 54) Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol \n15:40:39,271 WARN  [org.atmosphere.cpr.DefaultAsyncSupportResolver] (ServerService Thread Pool -- 54) Failed to create AsyncSupport class: class org.atmosphere.container.JSR356AsyncSupport, error: java.lang.reflect.InvocationTargetException\n15:40:39,271 ERROR [org.atmosphere.cpr.DefaultAsyncSupportResolver] (ServerService Thread Pool -- 54) Real error: Unable to configure jsr356 at that stage. ServerContainer is null: java.lang.IllegalStateException: Unable to configure jsr356 at that stage. ServerContainer is null\n    at org.atmosphere.container.JSR356AsyncSupport.<init>(JSR356AsyncSupport.java:51) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.atmosphere.container.JSR356AsyncSupport.<init>(JSR356AsyncSupport.java:40) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_40]\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_40]\n    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_40]\n    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_40]\n    at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:234) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:306) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:292) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:2082) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:914) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:838) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.primefaces.push.PushServlet.configureFramework(PushServlet.java:84) [primefaces-5.2.13.jar:5.2.13]\n    at org.primefaces.push.PushServlet.configureFramework(PushServlet.java:36) [primefaces-5.2.13.jar:5.2.13]\n    at org.atmosphere.cpr.AtmosphereServlet.init(AtmosphereServlet.java:84) [atmosphere-runtime-native-2.4.6.jar:2.4.6]\n    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]\n    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1112) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]\n    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3593) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]\n    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3802) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]\n    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.5.Final-redhat-3.jar:7.5.5.Final-redhat-3]\n    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.5.Final-redhat-3.jar:7.5.5.Final-redhat-3]\n    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.5.Final-redhat-3.jar:7.5.5.Final-redhat-3]\n    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_40]\n    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_40]\n    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]\n    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]\n    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]\n    at org.jboss.threads.JBossThread.run(JBossThread.java:122)\n\n15:40:39,287 WARN  [org.atmosphere.cpr.DefaultAsyncSupportResolver] (ServerService Thread Pool -- 54) Found multiple containers, please specify which one to use: org.atmosphere.container.JBossWebCometSupport, org.atmosphere.container.TomcatCometSupport, org.atmosphere.container.NettyCometSupport,  until you do, Atmosphere will use:class org.atmosphere.container.JBossWebCometSupport\n15:40:39,287 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 54) Installing Default AtmosphereInterceptors\n```\n\nIn addition, in 2.4.6 (2.4.x I think) only, there is one more JavaScript error which made the **Long Polling not working** ... so we are using 2.3.8 \nHere the JavaScript error:\n\n```\nGET https://localhost:8443/framework-ui-jsf2-showcase/primepush/t…ng&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true&_=1473947025239 500 (Internal Server Error)\n```\n\nSo unfortunately I can't use WebSockets !\n\nMy actual files:\npom.xml\n\n``` xml\n<dependency>\n    <groupId>org.atmosphere</groupId>\n    <artifactId>atmosphere-runtime</artifactId>\n    <version>2.3.8</version>\n</dependency>\n```\n\nstandalone.xml (JBoss config)\n\n``` xml\n<subsystem xmlns=\"urn:jboss:domain:web:2.2\" default-virtual-server=\"default-host\" native=\"false\">\n    <connector name=\"http\" protocol=\"HTTP/1.1\" scheme=\"http\" socket-binding=\"http\" redirect-port=\"8443\"/>\n    <connector name=\"https\" protocol=\"HTTP/1.1\" scheme=\"https\" socket-binding=\"https\" enable-lookups=\"false\" secure=\"true\">\n        <ssl name=\"ssl\" password=\"corp\" certificate-key-file=\"${jboss.server.config.dir}/store.jks\" protocol=\"TLSv1\" verify-client=\"false\"/>\n        <!-- <ssl name=\"ssl\" password=\"corp\" certificate-file=\"${jboss.server.config.dir}/cert.pem\" certificate-key-file=\"${jboss.server.config.dir}/key.pem\" protocol=\"TLSv1\" verify-client=\"false\"/> -->\n    </connector>\n    <virtual-server name=\"default-host\" enable-welcome-root=\"true\">\n        <alias name=\"localhost\"/>\n    </virtual-server>\n</subsystem>\n```\n\njboss-web.xml\n\n``` xml\n<jboss-web version=\"7.2\"\n        xmlns=\"http://www.jboss.com/xml/ns/javaee\"\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n        xsi:schemaLocation=\"http://www.jboss.com/xml/ns/javaee schema/jboss-web_7_2.xsd\">\n        <enable-websockets>true</enable-websockets>\n</jboss-web>\n```\n\nTo solve those problems, I search on the Wiki and Google, but those links did not solve the problem:\n- [Atmosphere Wiki - Installing JBoss WebSocket Support (January 2015)](https://github.com/Atmosphere/atmosphere/wiki/Installing-JBoss-WebSocket-Support)\n- [Atmosphere Wiki - Enabling WebSocket Support in JBoss EAP 6.3 and up (February 2015)](https://github.com/Atmosphere/atmosphere/wiki/Enabling-WebSocket-Support-in-JBoss-EAP-6.3-and-up)\n- [Atmosphere Wiki - Installing AtmosphereServlet with or without native support (January 2015)](https://github.com/Atmosphere/atmosphere/wiki/Installing-AtmosphereServlet-with-or-without-native-support)\n- [RedHat Support - Does JBoss EAP support the use of WebSockets? (April 2016)](https://access.redhat.com/solutions/47442)\n- [IT CROWD - Atmosphere configuration with JBoss AS 7.1.1 (November 2013)](http://blog.itcrowd.pl/2013/11/atmosphere-configuration-with-jboss-as.html)\n- [Vaadin Support - Configuring push for your environment (June 2013)](https://vaadin.com/wiki?p_p_id=36&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view&_36_struts_action=%2Fwiki%2Fview&p_r_p_185834411_nodeName=vaadin.com+wiki&p_r_p_185834411_title=Configuring+push+for+your+environment#section-Configuring+push+for+your+environment-JBoss+EAP+6.4+)\n\nIn addition, we saw that JBoss 6.4 natively supports WebSockets:\n1. [Download the native components (direct link from RedHat)](https://access.redhat.com/jbossnetwork/restricted/softwareDownload.html?softwareId=36993)\n2. Unzip and install those components (only the folder win-x86_64 in \\jboss-eap-6.4\\modules\\system\\layers\\base\\org\\jboss\\as\\web\\main\\lib) into $MODULE_PATH$/org/jboss/as/web/main/lib as described [here (RedHat support)](https://access.redhat.com/solutions/222023)\n3. [Download the jboss-websocket-hello from GitHub](https://github.com/jboss-developer/jboss-eap-quickstarts/tree/6.4.x/websocket-hello)\n4. Launch it and test native WebSocket\n\nSince we had this, we add Atmosphere (tested with 2.3.8 and 2.4.6) and we **obtain the same error**, so the problem is not coming from PrimeFaces.\n\nHow can I fix this ? (and **use WebSocket with JBoss 6.4.5**)\n"},"comment":{"url":"https://api.github.com/repos/Atmosphere/atmosphere/issues/comments/263193016","html_url":"https://github.com/Atmosphere/atmosphere/issues/2213#issuecomment-263193016","issue_url":"https://api.github.com/repos/Atmosphere/atmosphere/issues/2213","id":263193016,"user":{"login":"saikiran939","id":943751,"avatar_url":"https://avatars.githubusercontent.com/u/943751?v=3","gravatar_id":"","url":"https://api.github.com/users/saikiran939","html_url":"https://github.com/saikiran939","followers_url":"https://api.github.com/users/saikiran939/followers","following_url":"https://api.github.com/users/saikiran939/following{/other_user}","gists_url":"https://api.github.com/users/saikiran939/gists{/gist_id}","starred_url":"https://api.github.com/users/saikiran939/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saikiran939/subscriptions","organizations_url":"https://api.github.com/users/saikiran939/orgs","repos_url":"https://api.github.com/users/saikiran939/repos","events_url":"https://api.github.com/users/saikiran939/events{/privacy}","received_events_url":"https://api.github.com/users/saikiran939/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T06:28:07Z","updated_at":"2016-11-28T06:28:07Z","body":"I see that issue is closed, but EAP JBOSS 6.4 supports WebSockets out of the box.  Can you leverage it ?"}}
{"actor":{"display_login":"saikiran939"}}