Hibernate slf4j исключение
Я получаю следующее исключение при звонкеconfiguration.configure(hibernate.cfg.xml).buildSessionFactory()
:
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.Logger.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.ManyToOne.getType(ManyToOne.java:49)
at org.hibernate.mapping.ManyToOne.createForeignKey(ManyToOne.java:62)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2213)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2170)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2060)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:381)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)
at org.hibernate.cfg.Configuration.add(Configuration.java:702)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:537)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:599)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1621)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at com.enwelib.server.hibernate.helper.HibernateVendHelper.<init>(HibernateVendHelper.java:47)
at com.ensarm.crawler.CrawlManager.saveEntity(CrawlManager.java:93)
at com.ensarm.crawler.CrawlManager.main(CrawlManager.java:30)
1 ответ
Метод Logger.isTraceEnabled()
был добавлен в slf4j 1.4. По-видимому, вы используете более старую версию, в то время как Hibernate требует более свежую версию. Пересмотрите свой CLASSPATH и используйте более новую версию этой библиотеки (в настоящее время 1.6.4).