.war 文件未部署在 tomcat 服务器 7.0 上
我有两个疑问,我将在下面详细说明:
我在我的 ubuntu 机器 11.04 上安装了 tomcat 7.0。
1. .war 文件未部署
当我通过终端启动 tomcat 时,它工作正常,我可以在 http://localhost::8080/< 处看到 tomcat 网页/a>.之后,我尝试部署一个 war 文件 ps.war,将其复制到 tomcat 安装目录内的 webapps 文件夹中。然后我重新启动服务器,但即使 .war 已被 tomcat 提取到 ps 文件夹,也会出现相同的 404 错误。
2. 不通过eclipse运行
当我通过 Eclipse 打开它时,它在 Eclipse 控制台中显示服务器已启动并同步,但不运行任何服务并给出 HTTP 404 错误。同样在这种情况下,当我打开浏览器窗口时,我会在 http://localhost::8080// 处收到相同的 404 错误
请帮助我,因为我现在陷入困境,无法进一步运行网络服务。提前致谢。
I have two queries which I am detailing below:
I installed tomcat 7.0 on my ubuntu machine 11.04.
1. .war file not deployed
When I start tomcat through terminal it works fine and I am able to see the tomcat webpage at http://localhost::8080/. After that I try to deploy a war file ps.war which I copy into the webapps folder inside the tomcat installation directory. And then I restart the server but get the same 404 error even when the .war has been extracted to a ps folder by tomcat.
2. Not running through eclipse
when I open it through eclipse then it shows in eclipse console that the server is started and synchronized but does not run any service and give HTTP 404 eroor. Also in this case, When I open a browser window then I get same 404 error at http://localhost::8080//
Please help me put as I am quite stuck at this moment and not able to run the web services any further. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
@ezile 我可以理解第一个查询
.war
文件有错误,这就是为什么你无法通过浏览器获取它。但对于第二个查询解决方案,我如何接受制作正确的
.war
文件使http://localhost:8080
在 eclipse 中运行...我问这个问题为我有同样的(第一和第二)困难!
@ezile i can understand for the first query that
.war
file was faulty thats why you were unable to get it through the browser..but for second query solution how can i accept that making a correct
.war
file madehttp://localhost:8080
running in eclipse...I am asking this question as i am having the same (first and second) difficulty !!
您的意思是在 URL 中的端口号之前添加两个冒号吗?应该只是一个吧
http://localhost:8080
接下来,在 Tomcat 安装目录中,有一个名为
logs
的目录,其中包含一些日志文件,这些文件将提供比更详细的信息。您在浏览器中看到的 >404
消息。Did you mean to have two colons in your URL before the port number? It's supposed to just be one.
http://localhost:8080
Next, in your tomcat installation directory there is a directory called
logs
which contains a few log files which will provide more information than just the404
message you see in your browser.我们之前遇到过的另一件需要检查的事情是案例。我发现 WebContent\WEB-INF 大小写错误(即小写)并且 Tomcat 不想获取战争工件。
One other thing to check which we've ran into before is case. I have seen a problem with WebContent\WEB-INF being the wrong case (i.e. lower case) and Tomcat not wanting to pick up the war artifacts.
感谢大家的回复。我解决了这个问题。对于第一部分,我的 .war 文件存在一些问题,这就是它未部署的原因。
其次,在我纠正了我的战争之后,它也自动开始为 Eclipse 工作。
Thanks all for your responses. I solved the problem. For first part there was some problems with my .war file and thats why it was not getting deployed.
For second, after I corrected my war, it automatically started working for eclipse too.
就我而言,这是因为 WAR 需要完整路径。
我指定了 localhost:8080/WarFileName ,但这
不起作用。只有当我指定
localhost:8080/WarFileName/src/homepage
(这就是在
war
文件中创建包的方式)时,它才起作用。In my case it was because the WAR required a full path.
I had specified
localhost:8080/WarFileName
Which didn't work. It was only when I specified
localhost:8080/WarFileName/src/homepage
Which was how the packages were created in the
war
file, that it worked.