首页 > 技术文章 > JavaWeb项目报错:The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

move22 2018-09-26 17:16 原文

问题描述:

加上contextpath也是报这个错误,加上工程名称demo(contextPath不配置)也报这个错误

不使用localhost使用IP地址或者127.0.0.1也报这个错误

同样的工程在别人的环境下可以正常运行(本机使用IDEA启动也可以正常访问)

而且还有一个很奇怪的问题是:明明是使用log日志,明明已经debug显示都已经进来了,但是在Idea的控制台上还是看不到日志记录。可以进入自定义的Filter,但是在Controller中打debug,但是偏偏就没有进来。

在网上各种搜索半天都是找不到合适的解决方案,后来无意中看到一篇文章:

Spring boot启动成功但是报404:The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

 

其中的一个回答是:找到一个解决方法:把maven本地库的所有内容全部删除,然后重新更新下载jar包后,再启动,就好了

看到这里,在Idea中执行clean,install后,再次启动服务,访问正常!!!!

说明是下载的jar包有问题。

想对应的项目是:RestSpringMVCDemo:https://github.com/githubofrico/RestSpringMVCDemo,对应的文章是[REST风格框架实战:从MVC到前后端分离(附完整Demo) - CSDN博客](https://blog.csdn.net/justloveyou_/article/details/74379479)

 

推荐阅读