IllegalArgumentException: Could not resolve resource location pattern [classpath .xml]: class path

Posted 乐之者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IllegalArgumentException: Could not resolve resource location pattern [classpath .xml]: class path 相关的知识,希望对你有一定的参考价值。

查看编译后的classes文件后,没有mapper.xml文件,所以SQLsessionfactory不能读取成功。

在Maven中加入如下的resources配置:

<dependencies>
//相关的依赖包
</dependencies>
.....
<resources>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
          <include>**/*.tld</include>
        </includes>
        <filtering>false</filtering>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
          <include>**/*.tld</include>
        </includes>
        <filtering>false</filtering>
      </resource>
</resources>

 

以上是关于IllegalArgumentException: Could not resolve resource location pattern [classpath .xml]: class path 的主要内容,如果未能解决你的问题,请参考以下文章

IllegalArgumentException:无效的列纬度

Retrofit-IllegalArgumentException:意外的 url

引起:java.lang.IllegalArgumentException:属性'driverClassName'不能为空

IllegalArgumentException:接收方未注册

IllegalArgumentException 介绍

java.lang.IllegalArgumentException:基本 URI 不能为空