-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: New 3.3.0 SP1 doesn't include all of the slf jars
PostPosted: Tue Aug 26, 2008 11:22 am 
Newbie

Joined: Tue Aug 26, 2008 11:15 am
Posts: 1
I get the following error about StaticLoggerBinder when I try to startup my application with the latest hibernate released a few days ago. I guess I have to go hunting for the jars for slf4j. Could you include them please?

Ryan

Hibernate version: 3.3.0 SP1

Full stack trace of any exception that occurs:

26.Aug.08 10:02:11.222 INFO BaseXMLParser - Parsing C:\Documents and Settings\rshillington\BookHaulerPreferencesProd.xml
26.Aug.08 10:02:12.488 INFO HibernateRunner - Configuring Hibernate...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "Thread-2" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:151)
at com.bookhauler.hibernate.HibernateRunner.<clinit>(HibernateRunner.java:41)
at com.bookhauler.application.UIUtils.getHibernate(UIUtils.java:45)
at com.bookhauler.application.SplashWindow$4.run(SplashWindow.java:199)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class com.bookhauler.hibernate.HibernateRunner
at com.bookhauler.application.UIUtils.getHibernate(UIUtils.java:45)
at com.bookhauler.application.SplashWindow$1.actionPerformed(SplashWindow.java:110)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
26.Aug.08 10:03:01.269 INFO SplashWindow - Loading: Initializing Hibernate...
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 26, 2008 12:06 pm 
Newbie

Joined: Thu Jul 10, 2008 12:28 pm
Posts: 1
That class is not part of the hibernate distribution. Along with the slf4j-api.jar you need to include the implementation JAR. I've included slf4j-log4j12-1.5.2.jar.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 11:29 pm 
Beginner
Beginner

Joined: Tue May 03, 2005 11:45 pm
Posts: 43
I'm trying to upgrade to:

hibernate-3.3.0-sp1
hibernate-annotations-3.4.0-ga
hibernate-search-3.1.0-beta1

I'm also using spring 2.0. When I try run my java class from the command line I'm seeing this stack trace. I read somewhere that this is a confusion between commons-logging and slf4j. Commons logging is a requirement for spring and slf4j seems to be a new requirement for the latest hibernate annotations and 3.3.0

Caused by: java.lang.NoSuchFieldError: TRACE
at org.slf4j.impl.Log4jLoggerAdapter.trace(Log4jLoggerAdapter.java:90)
at org.hibernate.cfg.annotations.PropertyBinder.make(PropertyBinder.java:184)
at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1911)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1279)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:754)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:546)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:291)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1319)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:728)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:668)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1175)
... 20 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2008 8:24 pm 
Newbie

Joined: Thu Nov 30, 2006 6:09 pm
Posts: 9
Update Log4j (if you have it) to version 1.2.14

You'll find it in the EntityManager and Validator distributions, among others.


Top
 Profile  
 
 Post subject: didn't worked....
PostPosted: Fri Sep 19, 2008 2:10 am 
Newbie

Joined: Fri Sep 19, 2008 2:00 am
Posts: 2
I have added the log4j-1.2.14.jar but could not solve the eproblem...

Actually i am upgrading to "hibernate-distribution-3.3.1.GA-dist" with "hibernate-annotations-3.4.0.GA"


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
10:55:14,328 ERROR [com.icubicles.resumelocker.core.services.HibernateService: 90] Initial SessionFactory creation failed.
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:151)
at com.icubicles.resumelocker.core.services.HibernateService.<clinit>(HibernateService.java:55)
at com.icubicles.resumelocker.core.services.PersistanceManager.getSession(PersistanceManager.java:30)
at com.icubicles.resumelocker.core.services.UserService.getUser(UserService.java:24)
at com.icubicles.resumelocker.web.LoginForm.validate(LoginForm.java:63)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:945)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:198)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.icubicles.resumelocker.servlets.SecurityFilter.doFilter(SecurityFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.icubicles.resumelocker.servlets.ResumeLockerFilter.doFilter(ResumeLockerFilter.java:69)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
10:55:14,328 ERROR [com.icubicles.resumelocker.servlets.SecurityFilter: 105] Servlet execution threw an exception
javax.servlet.ServletException: Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.icubicles.resumelocker.servlets.SecurityFilter.doFilter(SecurityFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.icubicles.resumelocker.servlets.ResumeLockerFilter.doFilter(ResumeLockerFilter.java:69)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ExceptionInInitializerError
at com.icubicles.resumelocker.core.services.HibernateService.<clinit>(HibernateService.java:91)
at com.icubicles.resumelocker.core.services.PersistanceManager.getSession(PersistanceManager.java:30)
at com.icubicles.resumelocker.core.services.UserService.getUser(UserService.java:24)
at com.icubicles.resumelocker.web.LoginForm.validate(LoginForm.java:63)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:945)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:198)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
... 17 more
Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:151)
at com.icubicles.resumelocker.core.services.HibernateService.<clinit>(HibernateService.java:55)
... 27 more


Top
 Profile  
 
 Post subject: Re: didn't worked....
PostPosted: Fri Sep 19, 2008 2:56 am 
Newbie

Joined: Thu Nov 30, 2006 6:09 pm
Posts: 9
ahmad.nk wrote:
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder


Read Post #2 about the slf4j implementation jar.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2008 6:43 pm 
Newbie

Joined: Thu Feb 28, 2008 3:38 pm
Posts: 2
Can I suggest this get bumped up to be more prominant on Hibernate downloads page. The Sept 12 release of SLF4J made this even more complicated since the latest release's implementation JARs aren't compatable w/ the API JAR Hibernate ships with forcing either some digging or replacing the API jar.

This may not be a "rocket science" type of issue, but it's still confusing to those who don't know what SLF4J is (and why be confusing when it's so easy not to be...)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 12, 2008 7:08 am 
Newbie

Joined: Mon Oct 06, 2008 10:46 am
Posts: 3
I agree, I just wanted a quick hibernate update because there were some problem with my Tomcat, and now I'm just getting bogged down in hibernate dependency hell.

I already had log4j-1.2.14 but according to http://www.slf4j.org/codes.html#StaticLoggerBinder I need to download slf4j-log4j12.jar from
http://www.slf4j.org/download.html

That didn't work so I needed slf4j-api as well.

It has just been a pain in the arse. Oh well, that's only a whole day wasted :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2009 8:27 am 
Newbie

Joined: Tue Sep 26, 2006 10:51 am
Posts: 6
Location: Berlin, Germany
Hi,

I have had the same problem :(
Here is what works fine for me (as part of maven file - easy to use) :
Code:
<dependencies>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <version>${hibernateCoreVersion}</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-annotations</artifactId>
         <version>${hibernateAnnotationsVersion}</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-commons-annotations</artifactId>
         <version>${hibernateCommonsAnnotationsVersion}</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-entitymanager</artifactId>
         <version>${hibernateEntityManagerVersion}</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-validator</artifactId>
         <version>${hibernateValidatorVersion}</version>
      </dependency>
      <dependency>
         <groupId>javax.persistence</groupId>
         <artifactId>persistence-api</artifactId>
         <version>${javaPersistenceVersion}</version>
      </dependency>
      <dependency>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
         <version>${log4jVersion}</version>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>${slf4jVersion}</version>
      </dependency>   
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-log4j12</artifactId>
         <version>${slf4jVersion}</version>
      </dependency>   
   </dependencies>
   <properties>
      <hibernateCoreVersion>3.3.1.GA</hibernateCoreVersion>
      <hibernateAnnotationsVersion>3.4.0.GA</hibernateAnnotationsVersion>
      <hibernateCommonsAnnotationsVersion>3.3.0.ga</hibernateCommonsAnnotationsVersion>
      <hibernateEntityManagerVersion>3.4.0.GA</hibernateEntityManagerVersion>
      <hibernateValidatorVersion>3.1.0.GA</hibernateValidatorVersion>
      <javaPersistenceVersion>1.0</javaPersistenceVersion>
      <log4jVersion>1.2.15</log4jVersion>
      <slf4jVersion>1.5.6</slf4jVersion>
   </properties>


I hope it can help you!

Regards
Albert

_________________
Albert Gorski agorski(at/)gmx(dot/)net


Top
 Profile  
 
 Post subject: Re: didn't worked....
PostPosted: Thu Apr 02, 2009 6:19 am 
Newbie

Joined: Fri Sep 19, 2008 2:00 am
Posts: 2
Jimr wrote:
ahmad.nk wrote:
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder


Read Post #2 about the slf4j implementation jar.



let it be more clear

please add implementation for the api (slf4j-api-1.5.2.jar) waht ever we require (i.e: slf4j-log4j12.jar; which is present in hibernate-entitymanager-3.4.0.GA.zip or get it from http://www.slf4j.org/dist/slf4j-1.5.2.zip)

point here is we need both api and specific implementation jar files,
i.e:

slf4j-api-1.5.2.jar and slf4j-log4j12.jar


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.