ClassNotFoundException: org.slf4j.LoggerFactory

2,270 views
Skip to first unread message

branni

unread,
Dec 25, 2010, 5:31:29 AM12/25/10
to Google Web Toolkit
Hi,
I'd like to use hibernate with gwt and maven, but I get an exception
this point:

new Configuration().configure().buildSessionFactory();

------------------
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.google.gwt.dev.shell.jetty.JettyLauncher
$WebAppContextWithReload
$WebAppClassLoaderExtension.findClass(JettyLauncher.java:354)
at
org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:
366)
at
org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:
337)

--------------------

The sl4f-jar is in my webapp/WEB-INF/lib folder....

My maven dependencies:

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.6.1</version>
</dependency>

Any tips?

zixzigma

unread,
Dec 25, 2010, 3:07:44 PM12/25/10
to Google Web Toolkit
1- is this line of code on your server side, or on the client ?

new Configuration().configure().buildSessionFactory();

2- are you using Log4J on the client or server ?

you cannot use any of these in GWT,
for logging on clientside, use this:
http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html


branni

unread,
Dec 26, 2010, 2:59:46 PM12/26/10
to Google Web Toolkit
I use this on serverside, in the client side I use the gwt-log.

David Chandler

unread,
Dec 27, 2010, 12:00:28 PM12/27/10
to google-we...@googlegroups.com
I'm using the following set of dependencies with Hibernate validator
successfully:

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>

<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>


</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>

Since you're using Maven, you shouldn't have slf4j jars in your
webapp/WEB-INF/lib dir, as Maven will put them in
target/[build-name]/WEB-INF/lib.

/dmc

> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

--
David Chandler
Developer Programs Engineer, Google Web Toolkit
w: http://code.google.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools

branni

unread,
Dec 27, 2010, 12:54:08 PM12/27/10
to Google Web Toolkit
Thanks, but now I've got another problem:

com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException:
This application is out of date, please click the refresh button on
your browser. ( Expecting version 5 from client, got 6. )

and I don't know what the problem with my remoteservice...
Reply all
Reply to author
Forward
0 new messages