• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Hibernate+GWT problem related to slf4j

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I am trying to run a very simple application using GWT (1.6.4) and Hibernate (3.3.1) together.
I keep getting this error :

Initial SessionFactory creation failed.
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory


I get the exception at this point in my simple HibernateUtil after an RPC call is made to the server and the server tries to create a SessionFactory to handle the transaction:
I get the exception at this line ---> Configuration config =new Configuration().configure();


I use the following xml:


YES, I have both the slf4j api and the slf4j-simple jar in my classpath. (tried NOP and slf4j-log4j instead of simple as well)
YES, I have tried both slf4j 1.5.6 and 1.5.2

Even though the LoggerFactory is right there in the api I get the ClassDefNotFound error.

I am guessing there is a clash with some other library...
My classpath contains :
gwt-user.jar
c3p0-0.8.5.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
ejb3-persistence.jar
hibernate3.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-entitymanager.jar
mysql-connector-java-5.1.6-bin.jar
log4j.jar
slf4j-api-1.5.2.jar
slf4j-simple-1.5.2.jar
jta-1.1.jar
antlr-2.7.6.jar
javassist-3.4.GA.jar
 
author and cow tipper
Posts: 5001
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you try to do something simple like:



in your code, does it compile? If it doesn't, then you don't have the slf4j on your design-time classpath either.

Try it, and see if you've even got access at design time.

-Cameron McKenzie


 
Cameron Wallace McKenzie
author and cow tipper
Posts: 5001
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any chance you're actually using a higher version of Hibernate? Annotations?

-Cameron McKenzie
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the same problem, and am using the latest versions.

Windows XP
Eclipse: 3.4.1 Build: M20080911-1700
Google Plugin for Eclipse 3.4
Google Web Toolkit SDK 1.6.4
GWT 1.6.4
Hibernate Core 3.3.1
Hibernate Annotations 3.4.0
SLF4J 1.5.6

Any thoughts?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was having this problem too. To solve this problem, just copy slf4f and slf4j-log4j (if you use log4j) jar file to war\WEB-INF\lib.
 
I didn't say it. I'm just telling you what this tiny ad said.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic