尝试让 tomcat 7 与 eclipse 3.6.1 一起工作
我正在尝试设置tomcat(v7.0.11)和eclipse(v3.6.1),以便我可以在eclipse中调试JSP页面。我正在阅读这些说明: http://www.coreservlets.com/Apache-Tomcat -Tutorial/tomcat-7-with-eclipse.html 我正在进行“将根(默认)Web 应用程序复制到 Eclipse 中”步骤。我做到了。但是,当我尝试访问 http://localhost:8080 时仍然收到 404 错误(通过 eclipse 启动 tomcat 后) 。
当我在 eclipse 中启动 tomcat 时,我在控制台中看到一些警告,但没有错误:
Mar 30, 2011 8:10:23 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JSPDataSource' did not find a matching property.
Mar 30, 2011 8:10:23 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JSPEssbase2' did not find a matching property.
I'm trying to set up tomcat (v7.0.11) and eclipse (v3.6.1) so that I can debug JSP pages in eclipse. I'm going through these instructions:
http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html
and I'm on the step "Copy the ROOT (Default) Web App into Eclipse." which I did. However I still get a 404 error when I try to access http://localhost:8080 (after starting up tomcat through eclipse).
When I start up tomcat in eclipse I see a couple of warnings in the console but no errors:
Mar 30, 2011 8:10:23 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JSPDataSource' did not find a matching property.
Mar 30, 2011 8:10:23 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JSPEssbase2' did not find a matching property.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些警告实际上并没有什么害处。
对于从Eclipse内部启动服务器时无法访问Tomcat默认主页的问题,首先删除Tomcat中所有已部署的项目,然后在Servers视图中双击Tomcat服务器条目以获取其配置。在左列的“服务器位置”下,选择“使用 Tomcat 安装”。这样 Eclipse 将完全控制 Tomcat,以便您能够通过 Tomcat 管理器访问默认 Tomcat 主页 http:// localhost:8080 当从 Eclipse 内部运行时。请注意,您不一定需要通过这种方式复制 Eclipse 工作区中的 ROOT。
(可选)还可以在服务器选项下选中将模块上下文发布到单独的 XML 文件。否则,Eclipse 将根据自己的喜好修改 Tomcat 的
server.xml
,这可能会导致那些无害的 XML 验证警告,因为 Tomcat 无法识别 Eclipse 特定的 XML 属性,Eclipse 使用这些属性来方便地关联将 Eclipse 项目添加到已部署的 Web 应用程序中。Those warnings does actually not harm.
As to the problem of Tomcat's default homepage not being accessible when the server is started from inside Eclipse, first remove any deployed projects from Tomcat, then doubleclick the Tomcat server entry in Servers view to get its configuration. At the left column, under Server Locations, select Use Tomcat installation. This way Eclipse will take full control over Tomcat, so that you will be able to access the default Tomcat homepage with the Tomcat Manager at http://localhost:8080 when running from inside Eclipse. Note that you don't necessarily need to copy the ROOT in Eclipse workspace this way.
Optionally also check Publish module contexts to separate XML files under Server options. Otherwise Eclipse will modify the Tomcat's
server.xml
to its own taste, which may cause exactly those harmless XML validation warnings because Tomcat doesn't recognize Eclipse-specific XML attributes which Eclipse uses for own convenience to relate the Eclipse project to the deployed webapp.