简体   繁体   English

当WAR文件工作时,Eclipse的Tomcat提供404 - 以前的解决方案不起作用

[英]Eclipse's Tomcat gives a 404 while the WAR file works-previous solutions don't work

So when I'm running my project through Eclipse's "Run on server" the 'server' doesn't work (when trying the URI http://localhost:8080/simpleapp/ there is an automated 404 Tomcat's webpage), but when compiling and deploying the WAR file through Tomcat's app manager it works fine (the exact same URI gives the response I expected). 因此,当我通过Eclipse的“Run on server”运行我的项目时,“服务器”不起作用(当尝试URI http:// localhost:8080 / simpleapp /有一个自动404 Tomcat的网页时),但是在编译时并通过Tomcat的应用程序管理器部署WAR文件,它工作正常(完全相同的URI给出了我期望的响应)。

How can I systematically solve the issue? 我该如何系统地解决这个问题? It's important for me to solve it since debugging is a living hell this way right now (can't do a step-by-step debugging,every time that I want to check something I have to re-deploy my project :( ). 对我来说解决它很重要,因为现在调试是一种活生生的地狱(不能一步一步地调试,每次我想检查一些我必须重新部署我的项目:()。

I've looked for hours for a solution so I've tried lots of different settings, and the proposed solutions don't work here. 我已经找了几个小时的解决方案,所以我尝试了很多不同的设置,所提出的解决方案在这里不起作用。 Specifically,when changing the server's configuration in Eclipse to 'use tomcat installation', it doesnt work through eclipse (and the WAR file cannot be undeployed and doesn't work either!),switch location doesn't work either... 具体来说,当将Eclipse中的服务器配置更改为“使用tomcat安装”时,它无法通过eclipse工作(并且WAR文件无法取消部署,也无法正常工作!),交换机位置也不起作用...

More details which are optional but might help: 更多细节是可选的但可能会有所帮助:

I have another project where the server through Eclipse does function, I've just used a different Maven archetype this time. 我有另一个项目,通过Eclipse的服务器运行,我这次只使用了不同的Maven原型。 When Eclipse's server 'worked' I used jersey-quick start-web app but this time I had to use (org.glassfish.jersey.archetypes:jersey-heroku-webapp (An archetype which contains a quick start Jersey-based web application project capable to run on Heroku)) and added dynamic web module through project facets and as I said now the Eclipse server doesn't work (oh and I've tried to delete the server and reset the configuration too, but no luck). 当Eclipse的服务器“工作”时,我使用了jersey-quick start-web app,但这次我不得不使用(org.glassfish.jersey.archetypes:jersey-heroku-webapp(一个包含快速启动的基于Jersey的Web应用程序项目的原型)能够在Heroku上运行))并通过项目方面添加动态Web模块,正如我现在所说的Eclipse服务器不起作用(哦,我已经尝试删除服务器并重置配置,但没有运气)。

Try to deploy your WAR using "Add and Remove" from the Servers view instead of using "Run on Server". 尝试使用“服务器”视图中的“添加和删除”部署WAR,而不是使用“在服务器上运行”。 If the WAR doesn't appear check the Project Facets and ensure that Dynamic Web module is enabled. 如果未显示WAR,请检查Project Facets并确保已启用Dynamic Web模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM