How to run Atmosphere Sample?
I have just downloaded the Atmosphere Samples from Github. When I ran jetty:run goal on the chat-sample, I have some problems.
I can access to the page (http://localhost:9090) with my browser, but when i start chatting, nothing append, because the server return an 404 error page for each AJAX request.
What am I doi开发者_开发问答ng wrong?
I had the same problem, and was able to solve it by running jetty not through maven but with jett-runner. You have to download 2 jars:
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
build the war with:
mvn package
and than you can run it by:
java -jar jetty-runner-8.1.4.v20120524.jar --jar jetty-websocket-8.1.4.v20120524.jar --path /atmosphere target/atmosphere-chat.war
now you can open your browser to:
http://localhost:8080/atmosphere/
Ok something similar happened to me recently. Along with no message being sent, there were also 404 errors for all the JS files. Thats when I realized that trailing slash in http://localhost:9090/
is important :)
精彩评论