I am new at Hibernate and was starting the tutorial. I worked my way through it but when I ran it I got the following problem:
Code:
0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
0 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
15 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
15 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
46 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
46 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
109 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : org/hibernate/tutorial/domain/Event.hbm.xml
140 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: org.hibernate.tutorial.domain.Event -> EVENTS
156 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
Initial SessionFactory creation failed.java.lang.AbstractMethodError: org.slf4j.impl.SimpleLogger.isTraceEnabled()Z
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.hibernate.tutorial.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:18)
at org.hibernate.tutorial.util.HibernateUtil.<clinit>(HibernateUtil.java:8)
at org.hibernate.tutorial.EventManager.createAndStoreEvent(EventManager.java:23)
at org.hibernate.tutorial.EventManager.main(EventManager.java:16)
Caused by: java.lang.AbstractMethodError: org.slf4j.impl.SimpleLogger.isTraceEnabled()Z
at org.hibernate.type.NullableType.<clinit>(NullableType.java:59)
at org.hibernate.Hibernate.<clinit>(Hibernate.java:103)
at org.hibernate.type.TypeFactory.<clinit>(TypeFactory.java:69)
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:283)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)
at org.hibernate.mapping.Property.isValid(Property.java:207)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:458)
at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)
at org.hibernate.tutorial.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:13)
... 3 more
I am pretty new at using maven. I saw somewhere on this forum about something similar being caused by incompatible versions of the slf4j components. Here is my POM dependancies :
Code:
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.8.0.GA</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.1</version>
</dependency>
</dependencies>
slf4j-simple version 1.3.1 causes slf4j-api-1.5.8 to be downloaded by maven. I tried to manually add a dependency for slf4j-log4j12-1.5.8 but 1.5.6 was the latest I could get. It didn't solve the problem.
Thanks in advance
EDIT: Sorry I pasted the wrong stack traceHere is the dependency graph which might help: