title: DbUnit testing a PostgreSQL database using JPA without Hibernate or Spring
body: <p>I'm trying to write a Java EE 6 application using JPA but without using Hibernate or Spring. I used Netbeans to generate the JPA classes, and I created the tables in Postgres, but I am not able to run DbUnit tests in those JPA classes.</p>
  
  <p>I have tried to base my test unit on the example described in this site: <a href="http://www.roseindia.net/testingtools/DbUnit/gettingstarted.shtml" rel="nofollow">http://www.roseindia.net/testingtools/DbUnit/gettingstarted.shtml</a> but it does not work. I keep getting a "<code>java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory</code>" even though I added slf4j to the project libraries in the IDE.</p>
  
  <p>One thing that I find rather odd about the roseindia site example is that it does not seem to have a caller object for the test object created. I am not sure if a caller object is even needed (complete n00b in JavaEE programming, and kind of lost still).</p>