-->
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.  [ 9 posts ] 
Author Message
 Post subject: hibernatetool + ant + log4j frustration (stupid)
PostPosted: Fri Jan 20, 2006 6:28 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 4:44 pm
Posts: 22
i an using eclipse and i have an ant build file i'm using to reverse engineer a schema. i have the ant build set up as an External Tool in eclipse, with no additional configuration beyond the default. ultimately, the hibernatetool task successfully reverse engineers the schema i'm interested in (which indicates that i'm doing *something* right), but i can't for the life of me get hibernatetool to log output. no matter what i do, i always get this error:

Code:
Buildfile: C:\Documents and Settings\km623\Desktop\antreveng.xml
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.


it's driving me up a wall. i am just trying to use the standard "log4j.properties" file included with the hibernate tools distribution, and no matter where i put it, it gets ignored. i've searched the forums here pretty thoroughly (i think) and the solutions seems to be "put log4j.properties in the classpath", so i explicity specified a classpath for it in my build and it still doesn't work.

Code:
<project>
     <path id="hibernate-tools">
      <fileset dir="C:\Program Files\eclipse-SDK-3.1.1-win32\eclipse\plugins\org.hibernate.eclipse_3.1.0.beta2\lib\tools">
         <include name="*.jar" />
      </fileset>

      <fileset dir="C:\Program Files\eclipse-SDK-3.1.1-win32\eclipse\plugins\org.hibernate.eclipse_3.1.0.beta2\lib\hibernate">
         <include name="*.jar" />
      </fileset>
      
      <fileset dir="C:\Program Files\Java\Oracle 10g 10.2.0.1.0 JDBC">
         <include name="*.jar" />
      </fileset>
   </path>

   <path id="hibernate-log4j-config">
      <pathelement location="C:\Documents and Settings\km623\eclipse\workspace\testhibernate\src\log4j.properties"/>
   </path>

   <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
      <classpath refid="hibernate-tools"/>
   </taskdef>

   <hibernatetool destdir="C:\Documents and Settings\km623\Desktop\testantreveng\">
      <classpath refid="hibernate-log4j-config"/>
      <jdbcconfiguration configurationfile="C:\Documents and Settings\km623\eclipse\workspace\testhibernate\src\hibernate.cfg.xml"/>
      <hbm2java ejb3="true" />
      <hbm2hbmxml/>
   </hibernatetool>
</project>


any suggestions? disclaimer: i am not an ant guru. plus, i'm sure i'm just doing something really dumb, which is even more frustrating, ha ha...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 21, 2006 4:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it should of course be in the classpath of the taskdef where the hibernateool is loaded from

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 22, 2006 11:17 pm 
Newbie

Joined: Sun Jan 22, 2006 10:56 pm
Posts: 1
If you have added jars to the ant runtime in eclipse>preferences, try removing them or restore to default.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 11:49 am 
Beginner
Beginner

Joined: Thu Jan 12, 2006 4:44 pm
Posts: 22
altering the <path id> to the following results in a ZipException for me:

Code:
   <path id="hibernate-tools">
      <fileset dir="C:\Program Files\eclipse-SDK-3.1.1-win32\eclipse\plugins\org.hibernate.eclipse_3.1.0.beta2\lib\tools">
         <include name="*.jar" />
      </fileset>

      <fileset dir="C:\Program Files\eclipse-SDK-3.1.1-win32\eclipse\plugins\org.hibernate.eclipse_3.1.0.beta2\lib\hibernate">
         <include name="*.jar" />
      </fileset>
      
      <fileset dir="C:\Program Files\Java\Oracle 10g 10.2.0.1.0 JDBC">
         <include name="*.jar" />
      </fileset>

      <pathelement location="C:\Documents and Settings\km623\eclipse\workspace\testhibernate\src\log4j.properties"/>
   </path>



alternatively, altering the hibernatetool taskdef in this manner *also* results in a ZipException:

Code:
   <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
      <classpath refid="hibernate-tools"/>
      <classpath refid="hibernate-log4j-config"/>
   </taskdef>


in short, trying to add this file to the classpath explicitly for the taskdef is resulting in a ZipException.

the Eclipse External Tools classpath is set to the default; i.e., the default Ant Home and Additional Tasks & Support.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 1:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
a classpath consists of *directories* or jars/zips - not single files.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 2:26 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 4:44 pm
Posts: 22
max wrote:
it should of course be in the classpath of the taskdef where the hibernateool is loaded from


which i believe i have specified as the "hibernate-tools" classpath. please correct me on this if i'm wrong.

for example, i have put the default log4j.properties file into "C:\Program Files\eclipse-SDK-3.1.1-win32\eclipse\plugins\org.hibernate.eclipse_3.1.0.beta2\lib\tools" and that is not working. is that not the classpath of the taskdef? the taskdef is working, as i am able to reverse engineer my schema, so i believe i must have specified the classpath properly and placed the log4j.properties file in that classpath. i don't know where i'm going wrong.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 4:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
<pathelement location="C:\Documents and Settings\km623\eclipse\workspace\testhibernate\src\log4j.properties"/>

That is a *file* not a directory.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 4:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
in other words

<pathelement location="C:\Documents and Settings\km623\eclipse\workspace\testhibernate\src\"/> would be much better.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 5:00 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 4:44 pm
Posts: 22
max, you're my hero! i owe you a beer. thank you *very* much for your patience; i knew it was something stupid...


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