The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
环境:jdk8 + tomcat8.5
嗯··,这两天复习,使用IDEA出现了让人头痛的问题…
当时只是简单的写了个servlet…
出现的现象是:
IDEA控制台显示如下:
18-Oct-2020 14:02:07.664 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 217 ms
18-Oct-2020 14:02:17.654 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [H:\apache-tomcat-8.5.41-windows-x64\apache-tomcat-8.5.41\webapps\manager]
18-Oct-2020 14:02:17.703 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [H:\apache-tomcat-8.5.41-windows-x64\apache-tomcat-8.5.41\webapps\manager] has finished in [48] ms
当时感觉是正常启动了,但是没有弹出浏览器…
之后查了博客,也换了别人的电脑尝试了,同样的环境版本下,我的跑不出来…
前前后后折腾了 7 个小时才解决。
解决方法:
使用notepad++在本地tomcat的bin目录下的 catalina.bat文件
找到这行代码,然后注释掉…
注释时候使用 rem 注释它
set JAVA_OPTS=-Xms256m -Xmx2048m -Dfile.encoding=utf-8
然后再次运行…
控制台打印:
18-Oct-2020 14:12:14.869 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 213 ms
Connected to server
[2020-10-18 02:12:15,125] Artifact springmvc-01-servlet:war exploded: Artifact is being deployed, please wait...
[2020-10-18 02:12:15,190] Artifact springmvc-01-servlet:war exploded: Artifact is deployed successfully
[2020-10-18 02:12:15,190] Artifact springmvc-01-servlet:war exploded: Deploy took 65 milliseconds
18-Oct-2020 14:12:24.860 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [H:\apache-tomcat-8.5.41-windows-x64\apache-tomcat-8.5.41\webapps\manager]
18-Oct-2020 14:12:24.886 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [H:\apache-tomcat-8.5.41-windows-x64\apache-tomcat-8.5.41\webapps\manager] has finished in [25] ms
而且浏览器自己弹出来了…一切正常
总结: 我的IDEA比较自由,不能限制它内存的大小,给的大也不行
主要是注释这一段哦 :
JAVA_OPTS=-Xms256m -Xmx2048m
如果问题还没有解决,去查查你的tomcat的版本和你添加的web模块版本对应不…
完结撒花…