为什么Tomcat找不到我的Web应用程序? [英] Why can Tomcat not find my web application?

查看:201
本文介绍了为什么Tomcat找不到我的Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java Web Project我试图在我的Tomcat主机上运行。

I have a Java Web Project I'am trying to run on my Tomcat host.

我配置了我的Tomcat主机,以便Eclipse认识到我可以运行web应用程序在它上面。

I configured my Tomcat host so that Eclipse recognizes that I can run web apps on it.

这就是我的网络应用程序结构。 (在完成下面提到的副本之后)

This is what my web app structure looks like. (after doing the copy mentioned below)

我相信我有所有必要的配置文件等。但是当我运行我的项目时,我一直得到一个

I believe I have all the necessary config files, etc. However when I run my project, I keep getting a

HTTP状态404 / AirlineReservationSystem /请求的资源不可用错误。

HTTP Status 404 /AirlineReservationSystem/ requested resource is not available error.

从阅读 server.xml ,我认为问题出在这里,因为它控制服务器特定的配置(比如告诉服务器在哪里找到AirlineReservationSystem)

From reading about server.xml, I believe the problem lies here because it controls server specific configurations(like telling the server where to find AirlineReservationSystem is)

所以我看一下,看看这个配置设置

So I take a look at that and see this config setting

Context docBase="AirlineReservationSystem" path="/AirlineReservationSystem" reloadable="true" source="org.eclipse.jst.jee.server:AirlineReservationSystem"/>

我从 Apache Tomcat ,docbase定义Web应用程序的目录。阅读之后我的思考过程是找不到我的web应用程序,因为它不在localhost-config下的Tomcat v8.0服务器内。所以我将我的网络应用程序复制到该文件夹​​中,但现在当我运行副本时,它不会加载任何内容。

I read from Apache Tomcat that docbase defines the directory of the web application. My thought process after reading that is that my web app isn't being found because it is not located inside the Tomcat v8.0 Server at localhost-config. So I copy my web app into that folder but now when I run the copy, it doesn't load anything.

有谁知道问题是什么?为什么Tomcat找不到AirlineReservationSystem?根据我对Tomcat的有限经验,我的假设很可能是错误的。(你必须把它放在带有servers.xml的localconfig里)

Does anyone know what the issue is? Why Tomcat can't find AirlineReservationSystem? From my limited experience with Tomcat, my assumption could very well be wrong.(that you have to put it inside localconfig with servers.xml)

推荐答案

执行以下操作,并跳过不执行任何步骤:

Do the following, and skip no steps:


  1. 停止服务器

  2. 删除来自eclipse的服务器

  3. 清理您的项目

  4. 执行项目构建

  5. 添加服务器作为eclipse中的服务器。确保eclipse在添加后在服务器下面没有显示
    应用程序。

  6. 右键单击项目,选择Debug,然后调试
    服务器。它将显示一个对话框,要求您在
    上选择要运行它的服务器。选择新配置的tomcat服务器,
    选择每次都这样做选项。

  7. 等待

  8. 再等一下。观看控制台,直到它显示
    NNNNN msecs中的服务器启动或其他任何内容。

  1. stop the server
  2. delete the server from eclipse
  3. do a clean of your project
  4. do a build of your project
  5. add the server as a server in eclipse. Ensure that eclipse shows no application underneath the server after you've added it.
  6. right-click on your project, select "Debug", and then "Debug on server". It will present a dialog asking you to choose the server on which to run it. Choose your newly configured tomcat server, and select the "do this every time" option.
  7. Wait
  8. Wait some more. Watch the console until it says "server startup in NNNNN msecs", or whatever it is.

在10秒内那么,你的应用程序的第一页应该出现在eclipse的默认浏览器上(默认为内部浏览器)。

Within 10 seconds after that, your application's first page should appear on eclipse's default browser (which defaults to its internal one).

如果没有,那么在你做其他事情之前,请复制整个日志并粘贴在这里;将其添加到您的问题中,或将其置于问题的答案中。除密码和/或专有信息外,不要编辑它,不要遗漏任何内容。

If it does not, then before you do anything else, copy the entire log and paste it here; add it to your question, or put it in an "answer" to your question. Except for passwords and/or proprietary info, don't edit it, don't leave anything out.

这篇关于为什么Tomcat找不到我的Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆