Hi all, when running the SchemaExportTask or the Hbm2JavaTask everything works as it should but I get this warning. Yes I know I have to put the log4j.properties into the classpath than it works fine. That is what I did but it doesn't work. I searched the internet if anybody had the solution to this issue. I found the issue at Subject: Hibernate & Log4j but not the solution.
Now I'm here and hoping anybody can advice. Here are some details.
Classpath definition for Hibernate's SchemaExportTask:
Maybe somebody will be encountered to same issue here is a possible solution.
Though build.xml of my project has log4j.jar that ships with Hibernate in the classpath, SchemaExportTask and Hbm2JavaTask both use log4j.jar from the ANT distribution (for whatever reason).
As nothing helped I changed that, so that log4j.jar from the hibernate distribution is used. And it actually worked.
Then I checked the log4j.jar that came with ANT and the one which came with Hibernate. First they are different in size. The one with ANT is 339.5kB and the one with Hibernate is 344.4kB. Then I looked at the manifests and found out that ANT's log4j.jar was created by Java 1.4.2_05-b04 and Hibernate's by ANT 1.5.1 (I don't know which Java version is used with ANT 1.5.1), even though Hibernate 2.1.8 ships with ANT 1.5.3. Listings below show the differences in bold.
Manifest from log4j.jar V1.2.8 from ANT V1.6.2 distribution
Manifest from log4j.jar V1.2.8 from Hibernate V2.1.8 distribution
I have to say sorry. I made a mistake that's why it worked. I didn't link to any log4j-1.2.8.jar and so Hibernate couldn't find log4j and therefore used the Java logging mechanism, with which it worked.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Solution to "log4j:WARN No appenders could be found for logger"