我是靠谱客的博主 满意微笑,这篇文章主要介绍关于IDEA启动tomcat出错问题,现在分享给大家,希望可以做个参考。

今天使用IDEA跑项目的时候报错了,意思是我的项目编译后没有mapper文件在target下面。

报错类似如下:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [org/panda/mapping/*.xml].......

然后,玩这个这么久了,不可能不配置mapper啥,就觉得很神奇。

在网上查阅了哈,发现不止我这样,哈哈哈。

其实就是有些使用的IDEA会这样,有些又不会。

出现这个后在pom.xml里面的<build>标签里面添加:

<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>

重新启动tomcat发现被maven打包到target下面了。

 

希望能帮到大家

最后

以上就是满意微笑最近收集整理的关于关于IDEA启动tomcat出错问题的全部内容,更多相关关于IDEA启动tomcat出错问题内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(104)

评论列表共有 0 条评论

立即
投稿
返回
顶部