Monday, September 15, 2008

Fixing the Unitils Error "Missing configuration for org.unitils.core.dbsupport.DbSupport.implClassName"

If you get the following:
Caused by: org.unitils.core.UnitilsException: Missing configuration for org.unitils.core.dbsupport.DbSupport.implClassName at org.unitils.util.ConfigUtils.getConfiguredClassName(ConfigUtils.java:92) at org.unitils.util.ConfigUtils.getConfiguredInstance(ConfigUtils.java:53) at org.unitils.core.dbsupport.DbSupportFactory.getDbSupport(DbSupportFactory.java:76) at org.unitils.core.dbsupport.DbSupportFactory.getDefaultDbSupport(DbSupportFactory.java:56) at org.unitils.dbunit.DbUnitModule.getDefaultDbSupport(DbUnitModule.java:510) at org.unitils.dbunit.DbUnitModule.getDataSetFactory(DbUnitModule.java:479) at org.unitils.dbunit.DbUnitModule.getDataSetFactory(DbUnitModule.java:467) at org.unitils.dbunit.DbUnitModule.getDataSet(DbUnitModule.java:290) at org.unitils.dbunit.DbUnitModule.insertDataSet(DbUnitModule.java:144) ... 20 more
This basically means that the database.dialect you are using in your unitils.properties doesn't have a matching a property key that looks like "org.unitils.core.dbsupport.DbSupport.implClassName.(somedialectname)" in the unitils.properties (including those in the default unitils.properties on the classpath included in unitils). To fix, use one of the supported dialects: 'oracle', 'db2', 'mysql', or 'hsqldb' (for more recently added dialects, see the Unitils Cookbook).

3 comments:

Farshid said...

Thanks for the tip. It was a good help.

Yasser Zamani said...

Thank you very much...you saved me!

Константин Гадырка said...

Thanks a lot!