-->
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.  [ 4 posts ] 
Author Message
 Post subject: Exception while running the first sample in Hibernareference
PostPosted: Mon Sep 29, 2008 2:12 am 
Newbie

Joined: Fri Jul 27, 2007 5:39 am
Posts: 3
Hi all,

I am a newbie to Hibernate. When I am trying to run the first example given in the Hibernate reference, I am getting an exception

When I run the command ant run -Daction=store i am getting the following exception:

[java] Initial SessionFactory creation failed.java.lang.NoClassDefFoundErro
rg/slf4j/LoggerFactory
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
[java] at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:1

[java] ... 3 more
[java] Java Result: 1

I've already placed the required slf4j.jar file in the required location. Can anyone please help me to reslove the problem.

Thanks in Advance,
DNV Srikanth.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 7:39 am 
Newbie

Joined: Fri Jul 27, 2007 5:39 am
Posts: 3
Can anyone please resolve the issue ??


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 8:41 am 
Beginner
Beginner

Joined: Fri Sep 26, 2008 2:39 am
Posts: 20
I had a similar problem with the logging.
I got it to work with log4j in the end by:

Putting the following jars in my lib directory:

log4j-1.2.15.jar
slf4j-api-1.5.3.jar
slf4j-log4j12-1.5.3.jar
commons-logging-1.1.1.jar

And a log4j.properties file in to my src directory with the following content:
Quote:
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

log4j.rootLogger=warn, stdout
log4j.logger.org.hibernate.tool.hbm2ddl=debug


Good luck, and I hope you get it up and running soon.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 9:30 am 
Newbie

Joined: Fri Jul 27, 2007 5:39 am
Posts: 3
Hi JP-Ulm

Thanks buddy. It worked like a magic. Thank You.

DNV Srikanth


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.