首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Primefaces时出现Atmosphere "async-supported set to true“错误

使用Primefaces时出现Atmosphere "async-supported set to true“错误
EN

Stack Overflow用户
提问于 2014-08-05 16:03:17
回答 1查看 2.3K关注 0票数 1

在我的基于primefaces的应用程序中,我使用atmosphere框架将数据从服务器推送到客户端。我正在将应用程序部署到tomcat 7.0.54。如果我通过ip和端口访问应用程序,一切似乎都很正常。使用本地主机或远程服务器ip都没有关系,它工作得很好。但当我试图通过Apache2后面的http://domainNameWithoutPort.com/appName访问应用程序时,Atmosphere在客户端(在Chrome上)抛出了这些异常:

代码语言:javascript
复制
WebSocket connection to 'ws://domain.com/appName/primepush/liveStream?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.0.8&X-Atmosphere-Transport=websocket&X-Cache-Date=0' failed: Error during WebSocket handshake: Unexpected response code: 501 domain.com/appName/javax.faces.resource/push/push.js.xhtml?ln=primefaces:1
Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent).
Websocket closed, wasClean: false
Websocket failed. Downgrading to Comet and resending
Failed to load resource: the server responded with a status of 501 (Not Implemented) http://domain.com/appName/primepush/liveStream?X-Atmosphere-tracking-id=0…k=1.0.8&X-Atmosphere-Transport=long-polling&X-Cache-Date=0&_=140722464408

以及服务器端的那些例外:

代码语言:javascript
复制
org.atmosphere.cpr.AsynchronousProcessor - Invalid request state. Websocket protocol not supported
org.atmosphere.cpr.AsynchronousProcessor - Invalid request state. AsyncContext#startAsync not supported. Make sure async-supported is set to true in web.xml

并且最终不更新客户端。我在web.xml中定义了<async-supported>true</async-supported>,但没有成功。

所用技术的版本;Primefaces版本: 3.5,Atmosphere版本: 2.1.5,Tomcat 7.0.54

希望有人能知道诀窍,

谢谢大家。

EN

回答 1

Stack Overflow用户

发布于 2014-08-06 02:40:43

在使用AJP (介于httpd和WebSocket之间)时,不支持Comet和Tomcat。如果你使用mod_proxy_http,Comet应该可以工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25133872

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档