I'm trying to figure out how to use Derby with the hibernate3 plugin,
followed by the dbunit plugin.

Here is my "derby" profile:

       <profile>
           <!-- Doesn't work: Another instance of Derby may have
already booted the database -->
           <id>derby</id>
           <properties>

<dbunit.dataTypeFactoryName>org.dbunit.ext.db2.Db2DataTypeFactory</dbunit.dataTypeFactoryName>

<hibernate.dialect>org.hibernate.dialect.DerbyDialect</hibernate.dialect>
               <jdbc.groupId>org.apache.derby</jdbc.groupId>
               <jdbc.artifactId>derby</jdbc.artifactId>
               <jdbc.version>10.2.2.0</jdbc.version>

<jdbc.driverClassName>org.apache.derby.jdbc.EmbeddedDriver</jdbc.driverClassName>
               <jdbc.url><![CDATA[jdbc:derby:appfuse;create=true]]></jdbc.url>
               <jdbc.username>any</jdbc.username>
               <jdbc.password>value</jdbc.password>
           </properties>
       </profile>

The hibernate3 plugin seems to work fine, but the dbunit plugin dies with:

[INFO] Error executing database operation: CLEAN_INSERT

Embedded error: Failed to start database 'appfuse', see the next
exception for details.

AFAICT, I need to have create=true in my jdbc.url to create the
database initially (like hsqldb does) and shutdown=true to shut it
down when I'm done with it. It doesn't seem possible to do that with
these plugins.

Any ideas?  I've pasted the relevant sections of my pom.xml below.

Thanks,

Matt

           <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>hibernate3-maven-plugin</artifactId>
               <version>2.0-SNAPSHOT</version>
               <configuration>
                   <components>
                       <component>
                           <name>hbm2ddl</name>

<implementation>annotationconfiguration</implementation>
                       </component>
                   </components>
                   <componentProperties>
                       <jdk5>true</jdk5>

<propertyfile>target/test-classes/jdbc.properties</propertyfile>

<configurationfile>src/test/resources/hibernate.cfg.xml</configurationfile>
                       <skip>${maven.test.skip}</skip>
                   </componentProperties>
               </configuration>
               <executions>
                   <execution>
                       <phase>process-test-resources</phase>
                       <goals>
                           <goal>hbm2ddl</goal>
                       </goals>
                   </execution>
               </executions>
               <dependencies>
                   <dependency>
                       <groupId>${jdbc.groupId}</groupId>
                       <artifactId>${jdbc.artifactId}</artifactId>
                       <version>${jdbc.version}</version>
                   </dependency>
               </dependencies>
           </plugin>
           <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>dbunit-maven-plugin</artifactId>
               <version>1.0-beta-1</version>
               <configuration>

<dataTypeFactoryName>${dbunit.dataTypeFactoryName}</dataTypeFactoryName>
                   <driver>${jdbc.driverClassName}</driver>
                   <username>${jdbc.username}</username>
                   <password>${jdbc.password}</password>
                   <url>${jdbc.url}</url>
                   <src>src/test/resources/sample-data.xml</src>
                   <type>${dbunit.operation.type}</type>
                   <skip>${maven.test.skip}</skip>
               </configuration>
               <executions>
                   <execution>
                       <phase>test-compile</phase>
                       <goals>
                           <goal>operation</goal>
                       </goals>
                   </execution>
               </executions>
               <dependencies>
                   <dependency>
                       <groupId>${jdbc.groupId}</groupId>
                       <artifactId>${jdbc.artifactId}</artifactId>
                       <version>${jdbc.version}</version>
                   </dependency>
               </dependencies>
           </plugin>

--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to