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

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

问题描述

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

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?

推荐答案

假设你有安装Tomcat的全部权限,尝试去http://localhost:8080/manager/html/, 如果您不知道进入该区域的密码,请在您的 ${tomcat-installation}/conf 目录中查找 tomcat-users.xml 文件,那应该有.如果其中没有条目,则您需要向其中添加如下条目:

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.

但长话短说,很可能是你项目的web.xml

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

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

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