Friday, September 19, 2008

DBUnit and slf4j

I had never heard of slf4j before this morning, and I have no idea why.  I'm usually pretty up on stuff.

I started to pull some test data with dbunit ( in case you aren't familiar with dbunit here's an excellent intro by Bill Siggelkow ), and when I ran it I got the following error :

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at org.dbunit.database.AbstractDatabaseConnection.<clinit>(
    at [my package and class].main(

The solution is to download slf4j, and add slf4j-api-1.5.2.jar and slf4j-log4j12-1.5.2.jar to the classpath (I'm using Eclipse so I threw it in the run dialog.)
Blogged with the Flock Browser


Bill on Rails said...

Thanks for the props! SLF4J (giving it a full 2 seconds of research :) looks to be somewhat similar to Commons Logging.

Em Busca do JavaBean Perfeito said...

Hi there

I am seriously considering to move from Log4j to slf4j api and logback for this reasons

I think you should look at this.

Hibernate and others are migrating too.


Em Busca do JavaBean Perfeito said...

Here is the link for logBack