Springboot devtools热部署Mybatis报错:Could not load [mapper/]

在使用SpringBoot devtools进行热部署时遇到Mybatis无法找到[mapper/]的错误,导致web服务器无法启动。错误源于devtools重启后无法加载映射文件。解决方法包括:1) 在`application.properties`中设置`spring.devtools.restart.enabled=false`禁用热加载;2) 或者修改`mybatis.mapperLocations`为`mybatis.mapperLocations=classpath*:mapper/*.xml`,使Spring查找所有classpath下的映射文件。
摘要由CSDN通过智能技术生成

使用SpringBoot devtools热部署功能,Mybatis出现无法找到映射文件的错误提示,导致无法启动web服务器的问题;

错误提示:

Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [mapper/]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1363) ~[tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1023) ~[tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.springframework.core.io.ClassPathResource.resolveURL(ClassPathResource.java:155) ~[spring-core-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:193) ~[spring-core-5.1.4.RELEASE.j
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DevTools failed to load source map: Could not load content for http://localhost:8080/css/bootstrap.css.map的报错是由于浏览器无法加载指定的source map文件导致的。source map文件通常用于将压缩后的代码映射回原始的开发代码,以便在调试过程中能够更方便地定位问题。 在这个特定的报错中,浏览器试图加载http://localhost:8080/css/bootstrap.css.map文件,但是无法找到该文件,因此报错。这可能是因为该文件不存在或者路径不正确。 解决这个问题的方法有几种: 1. 确保source map文件存在于指定的路径。检查http://localhost:8080/css/bootstrap.css.map文件是否存在,并确保路径正确。 2. 如果你使用的是开发工具或框架,例如Webpack或Vue CLI,可以尝试重新生成source map文件。这通常可以通过在配置文件中进行相应的设置来实现。 3. 如果你不需要使用source map文件进行调试,可以在开发工具中禁用source map加载。这样可以避免浏览器尝试加载不存在的文件。 总结起来,DevTools failed to load source map: Could not load content for http://localhost:8080/css/bootstrap.css.map的报错是由于浏览器无法加载指定的source map文件导致的。你可以通过检查文件路径、重新生成source map文件或禁用source map加载来解决这个问题。 #### 引用[.reference_title] - *1* [DevTools failed to load SourceMap Could not load content 控制台显示的这个警告是什么意思](https://blog.csdn.net/web13985085406/article/details/123731210)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [控制台出现报错DevTools failed to load source map: Could not load content for chrome-extension://的...](https://blog.csdn.net/Boale_H/article/details/118390708)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值