java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
2013-09-03 22:43
579 查看
本站文章均为 WayneWong 原创,转载务必在明显处注明:
转载自原文链接:http://blog.csdn.net/fromgrey/article/details/11020799
项目一期快做完了,要发布到测试环境中去,用maven打包很方便,一句mvn clean package就搞定,好,生成了war包并发布到环境中的tomcat去,一登录就发报java.lang.IllegalArgumentException: Mapped Statements
collection does not contain value for .....的错后来才发现,原来我把mybatis的xml文件放在跟它的.java接口一起,但maven打包的时候不会把在src/main/java里的xml文件也一起打包,所以就target/classes里找不到xml文件,网上找了下大概有两种解决方法,一种就是在src/main/resources里按mybatis的接口文件包层级创建文件夹,再把xml文件放进去,显然这种方式我不喜欢,因为我要修改文件的时候很不方便,会找得很烦。另一种就是修改pom.xml了,让程序打包的时候把xml复制到它们在target的目录里,如下
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.plugin.version}</version>
<executions>
<execution>
<id>copy-ads-resources-</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/com/sdk/repository/mapper/ads</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/java/com/sdk/repository/mapper/ads</directory>
<includes>
<include>*.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
如果有多个目录要复制怎么办,就写多几个<execution>复制就行了
$(".MathJax").remove();
转载自原文链接:http://blog.csdn.net/fromgrey/article/details/11020799
项目一期快做完了,要发布到测试环境中去,用maven打包很方便,一句mvn clean package就搞定,好,生成了war包并发布到环境中的tomcat去,一登录就发报java.lang.IllegalArgumentException: Mapped Statements
collection does not contain value for .....的错后来才发现,原来我把mybatis的xml文件放在跟它的.java接口一起,但maven打包的时候不会把在src/main/java里的xml文件也一起打包,所以就target/classes里找不到xml文件,网上找了下大概有两种解决方法,一种就是在src/main/resources里按mybatis的接口文件包层级创建文件夹,再把xml文件放进去,显然这种方式我不喜欢,因为我要修改文件的时候很不方便,会找得很烦。另一种就是修改pom.xml了,让程序打包的时候把xml复制到它们在target的目录里,如下
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.plugin.version}</version>
<executions>
<execution>
<id>copy-ads-resources-</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/com/sdk/repository/mapper/ads</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/java/com/sdk/repository/mapper/ads</directory>
<includes>
<include>*.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
如果有多个目录要复制怎么办,就写多几个<execution>复制就行了
$(".MathJax").remove();
相关文章推荐
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.fkit
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.dao
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value forCommand.c
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for /package
- 解决mybatis,java.lang.IllegalArgumentException Mapped Statements collection does not contain value for
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for queryAll
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for **
- Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for …
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
- spring整合mybatis bug解决java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ...
- MyBatis出现java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for EMPLOYE
- Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for U
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for study.my
- MyBatis异常java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
- Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ^
- 【Mybatis】java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for xxxx
- mybatis:java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for