Question

I'm using maven dbunit plugin (tweaked version 1.0-beta-3).

In my pom.xml file I have plugin defined with few executions:

<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

I'm getting following error on second execution during mvn verify build:

[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]

Can anyone tell what might be wrong? I couldn't find it anywhere on SO or google. Thanks!

Was it helpful?

Solution

For reference I'm posting solution, which caused me that problem. In flat-xml data file SlotDaoIT.xml I had wrong starting XML element:

<xxx.dataset>

Instead of just:

<dataset>

Ohhh crap copy-paste habits...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top