一、Tomcat报错:The origin server did not find a current representation for the target resource
友情链接:https://blog.csdn.net/qq_39501726/article/details/81560999
解决办法:
Tomcat没有找到你的项目,在新建服务的时候需要修改Tomcat的安装路径和部署路径。
要修改成自己本地的安装路径和Tomcat默认的执行路径,可以在Tomcat的sever.xml文件中查看(sever.xml路径:Tomcat安装路径/conf/sevet.xml),打开sever.xml文件,看到appBase=“webapps”;修改完成后就可以正常启动了。
二、服务器 出现 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. 错误
友情链接1:https://blog.csdn.net/ancientear/article/details/86975432
方法1)Project->Build Automatically。
方法2)web.xml或是文件部署路径错误
方法3)移除Tomcat Server中的项目
方法4)检查是否是XML版本出的问题
友情链接2:https://blog.csdn.net/qq_36296239/article/details/78627140
解决办法:
将 服务器 从eclipse 删掉 添加新的服务器 双击 server locations 可选,勾选中间一个。
若仍然报错,则需要检查jsp文件。WEB-INF文件下的 jsp文件,浏览器是不能直接访问到的,是受保护的。因此可把jsp文件挪到WebContent文件下。
若把jsp 文件 放到 WebContent 下面的文件夹里面,则访问路径为: localhost:8080 / 你的项目名称 / 你的放jsp的文件夹/jsp文件名称.jsp ,如:http://localhost:8080/JSTLTest/jsp/JSTLTest.jsp
第一个JSTLTest 为项目名称,jsp 为 WebContent 下面的 文件夹,专门存放 jsp文件的。 然后第二个JSTLTest为jsp文件,需要加后缀。
或者是在MVC架构的配置文件中增加视图解析图,添加前缀和后缀,返回给浏览器访问。
三、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
友情链接:https://www.cnblogs.com/move22/p/9708189.html
解决方法:
一般是maven的reposity库下载的jar包有问题。在maven update projects过程中若是出现中断、网络连接断开等情况,很容易造成maven下载的jar包出现问题。
因此需要把maven本地库的所有内容全部删除,然后重新更新下载jar包后,再启动,就好了。同时要在Idea中执行clean,install后,再次启动服务,才可能会出现正常访问的现象。
四、mybatis整合spring,使用org.mybatis.spring.mapper.MapperScannerConfigurer扫描出现问题(不建议,报错更多是因为maven reposity库内jar包出现问题)
友情链接:https://www.cnblogs.com/cfmshine/p/5441689.html
解决办法:
第一种方式:修改property name=“sqlSessionFactory” ref="sqlSessionFactory"为property name=“sqlSessionFactoryBeanName” value=“sqlSessionFactory”
原理:使用sqlSessionFactoryBeanName注入,不会立即初始化sqlSessionFactory, 所以不会引发提前初始化问题。
第二种:直接删掉
注意:在没有配置这一行时,必须配置一个以sqlSessionFactory命名的org.mybatis.spring.SqlSessionFactoryBean。
五、MyBatis: No MyBatis mapper was found in ‘[xx.mapper]’ package. Please check your configuration.
友情链接1:https://blog.csdn.net/zengchen__acmer/article/details/78336512
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFaction" />
<property name="basePackage" value="cn.[webpath].mapper" />
</bean>
友情链接2:https://blog.csdn.net/qinxian20120/article/details/80255976
出现问题的几种情形:
1)对应的Mapper目录写错;
2) 少了配置文件;
3)在应用入口类:XxxApplication.java中没有加入@MapperScan(basePackages = {""})注解;
4)注解方式不对。
六、设置maven自动下载jar包的sources以及JavaDoc
友情链接:https://blog.csdn.net/c353796317/article/details/53392332
1)eclipse:集成Maven后在Window–>Preference–>Maven
勾选上 download Artifact Sources 和 download Artifact JavaDoc,则下次下载更新时候,就可以下载Sources 和JavaDoc了。
2)Myeclipse:集成Maven后在Window–>Preference–>Maven4MyEclipse