-->
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: hibernate.cfg.xml not found on Eclipse
PostPosted: Thu Nov 20, 2003 12:33 pm 
Newbie

Joined: Tue Nov 18, 2003 6:09 pm
Posts: 7
Location: Macei
Hi,

I'm still using hibernate.properties file and I'd like to switch to hibernate.hbn.xml. The docs state that this files must be in the root
classpath... I tried to put it everywhere in my project definition... Knowing that src is in the classpath, I tried to put there...

src <----- put it here, but it didnt work
package

Hibernator doesn't find the config file, even if I directly use

Code:
Configuration cfg = new Configuration();
cfg.configure("hibernate.cfg.xml");


If you have been using Hibernate on Eclipse with the hibernate.cfg.xml, please let me know what I could check or how I can organize my directories for a better deployment...

regards,

_________________
Marcello Sales
) Java J2EE Programmer
(( Home-Work
|''|-. Rua Gon


Top
 Profile  
 
 Post subject: Re: hibernate.cfg.xml not found on Eclipse
PostPosted: Thu Nov 20, 2003 12:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I've never used Hibernator but having hibernate.xfg.xml in root of src (or in test) works on eclipse.
Code:
cfg.configure("/hibernate.cfg.xml");
is the good code.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: hibernate.cfg.xml configuration options...
PostPosted: Thu Nov 20, 2003 10:53 pm 
Newbie

Joined: Tue Nov 18, 2003 6:09 pm
Posts: 7
Location: Macei
Hi epbernard,

Now it's working fine... However, I'd like to know more options of the configuration, as well as documentation code on how to config it properly...

How could I desable the log4j warns via this configuration file? Always when I run persistent objects I get the following warns:

Code:
log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.


Thank you in advance

_________________
Marcello Sales
) Java J2EE Programmer
(( Home-Work
|''|-. Rua Gon


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 3:42 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You need to add a log4j.xml file in CP root.
There are plenty of samples of log4j.xml on the net.
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

   <appender name="STDOUT" class="org.apache.log4j.FileAppender">
           <param name="File" value="System.out" />   
           <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
          value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
           </layout>      
   </appender>
   
   <category name="org.apache.log4j.xml">

     <priority value="info" />
   </category>
   
   <root>
      <priority value ="debug" />
         <appender-ref ref="STDOUT" />
   </root>
   
</log4j:configuration>

_________________
Emmanuel


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.