-->
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.  [ 5 posts ] 
Author Message
 Post subject: Where do I configure logger for Hibernate tools?
PostPosted: Mon Jul 21, 2008 8:43 pm 
Beginner
Beginner

Joined: Mon Mar 17, 2008 2:50 pm
Posts: 24
Whenever I am running my build script I am getting warning in the build log:
Quote:
Executing Hibernate Tool with a Standard Configuration
1. task: hbm2java (Generates a set of .java files)
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.

here is what I have in my build target:
Code:
    <hibernatetool destdir="${build.java.dir}" templatepath="${tmpl.hibernate.dir}">
        <classpath>
            <pathelement location="${build.java.dir}" />
        </classpath>
        <configuration configurationfile="${build.conf.dir}/su2Hibernate.cfg.xml"/>
        <hbm2java jdk5="true" ejb3="false"/>
    </hibernatetool>

What else shall I specify to get rid of this warning?
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 3:15 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have a log4j.properties or log4j.xml in the root of the classpath you used with hibernate tools

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 2:16 pm 
Beginner
Beginner

Joined: Mon Mar 17, 2008 2:50 pm
Posts: 24
max wrote:
have a log4j.properties or log4j.xml in the root of the classpath you used with hibernate tools

I tried it and it does not work.
There is a log4j.properties in /etc directory under the hibernate installation.
I added this directory to the path defined in the taskdef and the warning still persists, i.e. it did not change anything.
I then change it to the following:
Code:
    <hibernatetool destdir="${build.java.dir}" templatepath="${tmpl.hibernate.dir}">
        <classpath>
            <pathelement location="${build.java.dir}" />
            <pathelement location="${hibernate}/etc"/>
        </classpath>
        <configuration configurationfile="${build.conf.dir}/su2Hibernate.cfg.xml"/>
        <hbm2java jdk5="true" ejb3="false"/>
        <hbm2dao destdir="${build.java.dir}" templatepath="${tmpl.hibernate.dir}">
        </hbm2dao>
    </hibernatetool>

Nothing has changed either. What else can I do?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 4:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it needs to be in the taskdef - that is where it works in our unittest so must work for you too

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 6:12 pm 
Beginner
Beginner

Joined: Mon Mar 17, 2008 2:50 pm
Posts: 24
max wrote:
it needs to be in the taskdef - that is where it works in our unittest so must work for you too

I tried it this way:
Code:
  <path id="toolslib">
      <path location="${hibernate}/hibernate3.jar" />
      <path location="${hibernate}/tools/hibernate-tools.jar" />
      <path location="${hibernate}/tools/freemarker.jar" />
      <pathelement location="${hibernate}/etc"/>
      <path>
          <fileset dir="${hibernate}/lib" includes="**/*.jar" />
      </path>
  </path>
  <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />

and it does not work either.


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