简体   繁体   English

从intellij运行tomcat时的持续警告

[英]Constant warning when running tomcat from intellij

All of a sudden, when i run tomcat from within intellij, the output console is constantly bombarded with messages. 突然之间,当我从intellij中运行tomcat时,输出控制台不断被消息轰炸。

(very) short video showing this: (非常)短视频显示:
http://screencast.com/t/ddBhIh3UZiA http://screencast.com/t/ddBhIh3UZiA

The messages constantly output is: 不断输出的消息是:

16:05:31,157  WARN http-nio-8222-exec-1 servlet.PageNotFound:198 - Request method 'HEAD' not supported
16:05:31,158  WARN http-nio-8222-exec-2 servlet.PageNotFound:1120 - No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'dispatcher'

I am using Spring 4.1 and tomcat 8. Java 8 and Windows 8.1 我使用的是Spring 4.1和tomcat 8. Java 8和Windows 8.1

This phenomenon didnt use to happen before and it suddently started occuring. 这种现象以前没有发生过,它突然开始发生。 What is going on? 到底是怎么回事?

I'm having the exact same problem. 我有完全相同的问题。 If you have your Tomcat run configuration set to open a browser on launch, IntelliJ will try to ping the website to ensure it's up prior to opening the browser. 如果您将Tomcat运行配置设置为在启动时打开浏览器,IntelliJ将尝试ping网站以确保在打开浏览器之前启动它。 I believe it's doing HEAD requests and since your site isn't set to answer / HEAD requests, you get the error. 我相信它正在执行HEAD请求,并且由于您的站点未设置为回答/ HEAD请求,因此您会收到错误消息。

Unchecking the "After launch" checkbox under "Open browser" in the server tab of the run configuration fixed it for me. 取消选中运行配置的服务器选项卡中“打开浏览器”下的“启动后”复选框,为我修复了它。

As for getting JetBrains to fix this, I'm not sure what to do about it. 至于让JetBrains解决这个问题,我不知道该怎么做。 I did just upgrade to 14.0.3 so that might be the cause... 我刚刚升级到14.0.3所以这可能是原因......

Solved by JetBrains in this ticket, and if you want you can change a Jar to avoid the regression. JetBrains在这张票中解决了,如果你想要你可以改变一个Jar以避免回归。

https://youtrack.jetbrains.com/issue/IDEA-135196 https://youtrack.jetbrains.com/issue/IDEA-135196

It seems your client is using HEAD has the request method. 看来你的客户端正在使用HEAD有请求方法。 It is similar to GET but it says to the server that it must not return message-body in the response. 它类似于GET,但它告诉服务器它不能在响应中返回消息体。

Either check your pages or client for HEAD requests or accept HEAD as RequestMethod like this: 检查您的页面或客户端是否有HEAD请求,或者接受HEAD作为RequestMethod,如下所示:

@RequestMapping(method = {RequestMethod.GET, RequestMethod.HEAD})

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

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