部署WAR文件给我一个404状态代码在Tomcat? [英] Deploying a WAR file gives me a 404 Status Code on Tomcat?

查看:798
本文介绍了部署WAR文件给我一个404状态代码在Tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Tomcat来说相当新鲜。我刚刚设法构建一个项目并将其导出为WAR文件。我尝试手动将WAR文件复制到Tomcat文件夹,然后重新启动。它创建了文件夹结构和所有内容,但是当我尝试访问应用程序时,我收到了404状态代码。我尝试通过Tomcat管理面板部署它,但我看到相同的行为。我做什么从根本上错误?

解决方案

假设您拥有Tomcat安装的完整权限,请尝试 http:// localhost:8080 / manager / html / ,如果您不知道进入该区域的密码,请查找 tomcat-users.xml您的 $ {tomcat-installation} / conf 目录中的文件,那应该有它。如果它没有条目,那么您将要添加如下所示的条目:

 < user username = usernamepassword =passwordroles =admin,manager/> 

查看您的应用程序是否显示在该屏幕中,如果是,点击链接并查看如果这让你在任何地方。如果没有,那么我建议遵循ifishers的建议,并查看日志文件以查看是否列出任何错误。



但长篇小说,很可能是某事被弄坏了你的项目的 web.xml


I am fairly new to Tomcat. I just managed to build a project and exported it as a WAR file. I tried manually copying a WAR file to the Tomcat folder then restarting. It created the folder structure and everything but I get a 404 Status code when I try to reach the application. I tried deploying it through the Tomcat Admin panel but I'm seeing the same behavior. Am I doing anything fundamentally wrong?

解决方案

Assuming that you have full privileges with the Tomcat installation, try going to http://localhost:8080/manager/html/, if you don't know the password to get into that area, look for the tomcat-users.xml file in your ${tomcat-installation}/conf directory, and that should have it. If it has no entries in it then you will want to add an entry like the following to it:

<user username="username" password="password" roles="admin,manager" />

See whether your application shows up in that screen, and if it does, click on the link and see if that gets you anywhere. If it doesn't, then I suggest following ifishers's advice, and looking at the log files to see if it lists any errors.

But long story short, most likely something is screwed up with your project's web.xml

这篇关于部署WAR文件给我一个404状态代码在Tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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