-->
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: where are Log and LogFactory classes (package namingproblem?
PostPosted: Tue May 24, 2005 6:50 am 
Beginner
Beginner

Joined: Tue May 17, 2005 7:39 am
Posts: 27
Location: Rome, Italy
Hibernate version:
3.0

i'm having problems at following the simple start with tomcat on hibernate reference, and i'm stuck in the example of the Cat, which reads as follows

"We implement a HibernateUtil helper class:

import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;
public class HibernateUtil {
private static Log log = LogFactory.getLog(HibernateUtil.class);"

my IDE (NetBeans) says it can't find Log class, that in my opinion should be in the net.sf.hibernate.* or import net.sf.hibernate.cfg.*.
I found out reading API documentation that the name of the hibernate 3.0 packages has changed, and now is org.hibernate.* so i modified my imports, but that brings to no solution.

i'm trying to find out where Log and LogFactory classes are packaged, and how to make it visible to my project.
thanx

mox


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 4:56 pm 
Newbie

Joined: Fri May 20, 2005 12:39 pm
Posts: 10
It's part of the Apache Commons Logging framework... you will find it in the Hibernate distribution under the lib directory; commons-logging-*.jar.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 4:30 am 
Beginner
Beginner

Joined: Tue May 17, 2005 7:39 am
Posts: 27
Location: Rome, Italy
infact i solved that problem with:
import org.apache.commons.logging.*;

but this is the error i get when i run my class:

Code:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
java.lang.ExceptionInInitializerError
    at HibernateUtil.<clinit>(HibernateUtil.java:30)
Caused by: org.hibernate.MappingException: Resource: Cat.hbm.xml not found
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:444)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1162)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1148)
    at HibernateUtil.<clinit>(HibernateUtil.java:27)
Exception in thread "main"
Java Result: 1


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 9:11 am 
Newbie

Joined: Fri May 20, 2005 12:39 pm
Posts: 10
See my answer to your other post for this solution...
http://forum.hibernate.org/viewtopic.ph ... highlight=


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.