Hi Gang,
I desperately need some help setting up a "Hello World" using Hibernate and Eclipse. I just can't seem to get it to work. I've downloaded the hibernate-distribution-3.5.0-Final and extracted the zip file. I've created a Eclipse project and added the following .jar files to my project:
hibernate3.jar
antlr-2.7.6.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
javassist-3.9.0.GA.jar
jta-1.1.jar
slf4j-api-1.5.8.jar
mysql-connector-java-5.1.12-bin.jar
But when I compile the code below I get an error
Code:
package hiberaction;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class Main
{
/**
* @param args
*/
public static void main(String[] args)
{
Configuration cfg = new Configuration();
cfg.addClass(hiberaction.pojos.Message.class);
cfg.setProperties(System.getProperties());
SessionFactory sessions = cfg.buildSessionFactory();
}
}
Code:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
I've tried adding other jars but I just can't get it to work. Doesn't the hibernate download come with all the jars that I need (besides the SQL connection)? I've added all the jars in the "required" folder of hibernate so why doesn't it work? ARGH!!!!!
Any tips?
Cheers
-whizzle-