尝试在Tomcat上部署我的Web应用程序的war文件时,获取HTTP Status 404错误 [英] Getting HTTP Status 404 error when trying to deploy war file of my web application on tomcat
问题描述
我已经在Eclipse中使用JSP创建了一个名为JSP_web_application_01的Web应用程序,我在ubuntu 12.04 LTS。我在WebContent目录下有index.jsp文件。我使用命令提示符创建了.war文件,为了部署它,将其放在tomcat的webapps文件夹中,并使用sudo $ CATALINA_HOME / bin / shutdown.sh命令停止tomcat,并再次由sudo $ CATALINA_HOME / bin / startup.sh
它膨胀了.war文件(JSP_web_application_01.war)并创建了JSP_web_application_01文件夹结构,除了我所得到的一切都是一个http 404状态码当我尝试从浏览器访问它:
http:// localhost:8080 / JSP_web_application_01 /
我得到这个:
HTTP状态404 - / JSP_web_application_01 /
类型状态报告
消息/ JSP_web_application_01 /
描述请求的资源不可用。
Apache Tomcat / 7.0.47
这是我的WebContent里面的web.xml文件/ WEB-INF文件夹
<?xml version =1.0encoding =UTF-8?>
< web-app xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexmlns =http://java.sun.com/xml/ns/javaeexsi :schemaLocation =http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsdid =WebApp_IDversion =3.0 >
< display-name> JSP_web_application_01< / display-name>
< welcome-file-list>
< welcome-file> index.html< / welcome-file>
< welcome-file> index.htm< / welcome-file>
< welcome-file> index.jsp< / welcome-file>
< welcome-file> default.html< / welcome-file>
< welcome-file> default.htm< / welcome-file>
< welcome-file> default.jsp< / welcome-file>
< / welcome-file-list>
< / web-app>
这是我第一次尝试托管Web应用程序。所以,任何帮助将不胜感激。
检查项目文件必须在JSP_web_application_01特别是index.jsp下进行解压缩。如果正确,请重新启动Web服务器,尾部日志文件在$ CATALINA_HOME / logs下,检查开始信息是否正确。
I know this questions was asked earlier yet any of the answers given did not fix my problem.
I have created a web application named JSP_web_application_01 using JSP in Eclipse and I'm on ubuntu 12.04 LTS. I have index.jsp file inside WebContent directory. I made the .war file of it using command prompt and in order to deploy it I put it inside the webapps folder of tomcat and stopped tomcat using the command sudo $CATALINA_HOME/bin/shutdown.sh and again started it by sudo $CATALINA_HOME/bin/startup.sh
And it inflated the .war file(JSP_web_application_01.war) and created the JSP_web_application_01 folder structure and everything but what I get is an http 404 status code when I try to access it from the browser using :
http://localhost:8080/JSP_web_application_01/
I get this :
HTTP Status 404 - /JSP_web_application_01/
type Status report
message /JSP_web_application_01/
description The requested resource is not available.
Apache Tomcat/7.0.47
This is my web.xml file that is inside WebContent/WEB-INF folder
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>JSP_web_application_01</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
This is my first time of trying to host a web application. So, any help would be much appreciated.
Check the project files must be decompressed under JSP_web_application_01 especially index.jsp. If it correct, restart web server, tail the log file under $CATALINA_HOME/logs, check the start info correct.
这篇关于尝试在Tomcat上部署我的Web应用程序的war文件时,获取HTTP Status 404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!