-->
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.  [ 2 posts ] 
Author Message
 Post subject: hbm2java and Log4j
PostPosted: Thu Aug 05, 2004 7:24 pm 
Newbie

Joined: Thu Jul 15, 2004 6:33 pm
Posts: 9
Location: Mill Valley, CA
Anyone using hbm2java in an ant task and *not* getting Log4j warning
messages? If so, can I see (the relevant parts) of your build.xml?

I used hbm2java in my build (the task works; source code created),
but for all I've tried, I cannot get Log4j connected. Just completed
an experiment starting from Hibernate's distribution files, adding a
simple hbm2java task to the given build.xml, changing as little as
possible, and I still get the same complaints from Log4j:

Code:
[hbm2java] Processing 1 files.
[hbm2java] Building hibernate objects
[hbm2java] log4j:WARN No appenders could be found for logger
                  (net.sf.hibernate.util.DTDEntityResolver).
[hbm2java] log4j:WARN Please initialize the log4j system properly.


This is with all Hibernate distribution files, in the structure given.
Adding only hibernate.jar and hibernate-tools.jar to /lib, and
defining classpath.project as (dir.lib = lib.dir, etc.):

Code:
  <path id="classpath.project">
    <fileset dir="${dir.lib}">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement path="${dir.bin}"/>
    <pathelement path="${dir.src}"/>
    <pathelement path="${dir.build}"/>
  </path>


This is the new task:

Code:
  <target name="codegen">
    <taskdef name="hbm2java"
      classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
      classpathref="classpath.project"/>

    <hbm2java output="${dir.src}">
      <classpath>
        <pathelement path="${classpath.project}"/>   
      </classpath>
      <fileset dir="${dir.src}">
        <include name="**/*.hbm.xml"/>
      </fileset>
    </hbm2java>
  </target>


The files are generated. Only the connect to Log4j fails.

I've been jammed on this one for several cycles. If you have hbm2java
working with Log4j, I'd really appreciate a look at your build.xml.

Versions: Hibernate: 2.1, Ant: 1.6.1, JVM: j2sdk-1.4.2.

Many thanks,

William BC Crandall
bc.crandall [around] earthlink.net


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 2:36 pm 
Beginner
Beginner

Joined: Mon Jul 26, 2004 4:29 pm
Posts: 45
Location: TX, USA
Check my post in the following topic:

http://forum.hibernate.org/viewtopic.php?t=933467&start=0&postdays=0&postorder=asc&highlight=


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