我正在使用maven dbunit插件(调整版本1.0-beta-3)。
在我的pom.xml
文件中,我有几个执行定义的插件:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dbunit-maven-plugin</artifactId>
<!--jar file that has the jdbc driver -->
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
</dependencies>
<configuration>
<driver>org.postgresql.Driver</driver>
<dataTypeFactoryName>org.dbunit.ext.postgresql.PostgresqlDataTypeFactory</dataTypeFactoryName>
<useQualifiedTableNames>true</useQualifiedTableNames>
</configuration>
<executions>
<!-- INSERTS -->
<execution>
<id>RequestDaoIT</id>
<phase>post-integration-test</phase>
<goals>
<goal>operation</goal>
</goals>
<configuration>
<url>jdbc:postgresql://${db.host}:${db.port}/${db.name}</url>
<username>${db.username}</username>
<password>${db.password}</password>
<format>flat</format>
<type>INSERT</type>
<src>src/test/resources/dbunit/RequestDaoIT.xml</src>
</configuration>
</execution>
<execution>
<id>SlotDaoIT</id>
<phase>post-integration-test</phase>
<goals>
<goal>operation</goal>
</goals>
<configuration>
<url>jdbc:postgresql://${db.host}:${db.port}/${db.name}</url>
<username>${db.username}</username>
<password>${db.password}</password>
<format>flat</format>
<type>INSERT</type>
<src>src/test/resources/dbunit/SlotDaoIT.xml</src>
</configuration>
</execution>
... CUT
我在mvn verify
构建期间第二次执行时遇到以下错误:
[ERROR] Failed to execute goal org.codehaus.mojo:dbunit-maven-plugin:1.0-XXXX:operation (SlotDaoIT) on project xxx-xxxxx-xxxxxx: Error executing database operation: INSERT: Current thread was interrupted (Thread=Thread[main,5,main]): NullPointerException -> [Help 1]
任何人都可以说出可能出错的地方吗?我无法在SO或谷歌的任何地方找到它。谢谢!
答案 0 :(得分:0)
作为参考我正在发布解决方案,这导致了我的问题。在flat-xml数据文件SlotDaoIT.xml
中,我错误地启动了XML元素:
<xxx.dataset>
而不仅仅是:
<dataset>
Ohhh废话复制粘贴习惯......