I am having trouble creating an export of my database using an org.dbunit.database.QueryDataSet. When I call org.dbunit.dataset.xml.FlatXmlDataSet.write(IDataSet, OutputStream), I get the following stack trace:
java.lang.IllegalStateException: Did not find column 'MYCOL' for <schema.table> 'MYSCHEMA .MYTABLE' in catalog 'MYDB' because names do not exactly match.
at org.dbunit.database.ResultSetTableMetaData.scrollTo(ResultSetTableMetaData.java:297)
at org.dbunit.database.ResultSetTableMetaData.createColumnFromDbMetaData(ResultSetTableMetaData.java:262)
at org.dbunit.database.ResultSetTableMetaData.createMetaData(ResultSetTableMetaData.java:154)
at org.dbunit.database.ResultSetTableMetaData.createMetaData(ResultSetTableMetaData.java:131)
at org.dbunit.database.ResultSetTableMetaData.<init>(ResultSetTableMetaData.java:97)
at org.dbunit.database.AbstractResultSetTable.<init>(AbstractResultSetTable.java:84)
at org.dbunit.database.AbstractResultSetTable.<init>(AbstractResultSetTable.java:63)
at org.dbunit.database.ForwardOnlyResultSetTable.<init>(ForwardOnlyResultSetTable.java:65)
at org.dbunit.database.CachedResultSetTableFactory.createTable(CachedResultSetTableFactory.java:52)
at org.dbunit.database.AbstractDatabaseConnection.createQueryTable(AbstractDatabaseConnection.java:90)
at org.dbunit.database.AbstractDatabaseConnection.createTable(AbstractDatabaseConnection.java:115)
at org.dbunit.database.QueryTableIterator.getTable(QueryTableIterator.java:143)
at org.dbunit.dataset.stream.DataSetProducerAdapter.produce(DataSetProducerAdapter.java:83)
at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:124)
at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:341)
In researching this, I saw that someone else had this problem back in February, and fixed it using a snapshot build of 2.4.4. I am using the regular release build of 2.4.4.
Any ideas?