我刚刚从 Github 下载了 Atmosphere 样本。当我在聊天样本上运行 jetty:run goal 时,我遇到了一些问题。
我可以使用浏览器访问该页面(http://localhost:9090),但是当我开始聊天时,没有任何附加内容,因为服务器为每个 AJAX 请求返回 404 错误页面。
我做错了什么?
最佳答案
我遇到了同样的问题,并且能够通过运行jetty而不是通过maven而是使用jett-runner来解决它。您必须下载 2 个 jar:
wget http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-websocket/8.1.4.v20120524/jetty-websocket-8.1.4.v20120524.jar
wget http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-runner/8.1.4.v20120524/jetty-runner-8.1.4.v20120524.jar
发动 war :
mvn package
你可以通过以下方式运行它:
java -jar jetty-runner-8.1.4.v20120524.jar --jar jetty-websocket-8.1.4.v20120524.jar --path /atmosphere target/atmosphere-chat.war
现在您可以打开浏览器来:
http://localhost:8080/atmosphere/
关于java - 如何运行 Atmosphere 样本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6094236/