CometD - 如何在tomcat jetty中运行demo

时间:2012-11-08 03:21:50

标签: java spring hibernate cometd

我尝试在CometD中运行演示aps。我已经安装了Maven。我按照命令here进行了操作。在我的控制台中,它显示[INFO] Starting scanner at interval of 1 seconds. 。我去了http://localhost:8080/并看到apache tomcat主页但我看不到任何项目。我怎么能看到这些项目。我想测试演示。请帮忙。

顺便说一句,下面是我运行命令mvn jetty:deploy-war启动jetty服务器后控制台中显示的日志:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building CometD :: Demo 2.5.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> jetty-maven-plugin:7.6.7.v20120910:deploy-war (default-cli) @ cometd-demo >>>
[INFO] 
[INFO] --- maven-enforcer-plugin:1.1.1:enforce (enforce-maven-version) @ cometd-demo ---
[INFO] 
[INFO] <<< jetty-maven-plugin:7.6.7.v20120910:deploy-war (default-cli) @ cometd-demo <<<
[INFO] 
[INFO] --- jetty-maven-plugin:7.6.7.v20120910:deploy-war (default-cli) @ cometd-demo ---
[INFO] Configuring Jetty for project: CometD :: Demo
[INFO] Context path = /
[INFO] Tmp directory = /home/tom/cometd-2.5.0/cometd-demo/target/tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
2012-11-08 11:30:14.862:INFO:oejs.Server:jetty-7.6.7.v20120910
2012-11-08 11:30:15.311:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
2012-11-08 11:30:15.742:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/home/tom/cometd-2.5.0/cometd-demo/target/tmp/webapp/},/home/tom/cometd-2.5.0/cometd-demo/target/cometd-demo-2.5.0.war
2012-11-08 11:30:16,026 main [ INFO][AnnotationCometdServlet] Processed annotated service org.cometd.examples.ChatService@1d91eb90
2012-11-08 11:30:16,027 main [ INFO][AnnotationCometdServlet] Registered annotated service org.cometd.examples.ChatService@1d91eb90 in servlet context
2012-11-08 11:30:16,105 main [ INFO][CometdDemoServlet] Monitored Subscribe from seti_51cw11a1uy7x5ygbmosqpdkirv - last connect 0 ms ago for /seti/http_localhost_8080_cometd
2012-11-08 11:30:16,109 main [ INFO][CometdDemoServlet] Monitored Subscribe from seti_51cw11a1uy7x5ygbmosqpdkirv - last connect 0 ms ago for /seti/all
2012-11-08 11:30:16,118 main [DEBUG][AuctionService] Mapping oortion#bids to /auction/*
2012-11-08 11:30:16,119 main [DEBUG][AuctionService] Mapping oortion#bid to /service/auction/bid
2012-11-08 11:30:16,119 main [DEBUG][AuctionService] Mapping oortion#bidder to /service/auction/bidder
2012-11-08 11:30:16,119 main [DEBUG][AuctionService] Mapping oortion#search to /service/auction/search
2012-11-08 11:30:16,119 main [DEBUG][AuctionService] Mapping oortion#category to /service/auction/category
2012-11-08 11:30:16,119 main [DEBUG][AuctionService] Mapping oortion#categories to /service/auction/categories
2012-11-08 11:30:16,122 main [DEBUG][AuctionChatService] Mapping chat#trackMembers to /auction/chat/**
2012-11-08 11:30:16,122 main [DEBUG][AuctionChatService] Mapping chat#privateChat to /service/auction/chat
2012-11-08 11:30:16.137:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 1 seconds.

1 个答案:

答案 0 :(得分:1)

日志显示Jetty已正确启动,我只是尝试了相同的说明,获取相同的日志,当我将浏览器指向localhost:8080时,我可以看到CometD主页。 / p>

如果您看到其他页面,那么您的浏览器可能已将其缓存;尝试重新加载页面。

你做的一切都是正确的,我认为这只是浏览器的积极缓存。

请注意,您发出的命令将启动Jetty,而不是Tomcat。

但是,您可以手动将CometD war部署到Tomcat中以使CometD在Tomcat中运行,但建议在Jetty中运行CometD。