Thanks very much bertrand for your response.
bertrand wrote:
Problem 1
This is an issue related to the configuration of the Log4J package. Please check their documentation (hint: you miss a log4j.properties in your classpath).
After I add another log4j properties specially for the hibernate task, I get another error as the followings:
hbm2java:
[hbm2java] Processing 4 files.
[hbm2java] Building hibernate objects
[hbm2java] java.util.zip.ZipException: error in opening zip file
[hbm2java] at java.util.zip.ZipFile.open(Native Method)
[hbm2java] at java.util.zip.ZipFile.<init>(Unknown Source)
[hbm2java] at java.util.zip.ZipFile.<init>(Unknown Source)
[hbm2java] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:903
)
[hbm2java] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hbm2java] at org.apache.log4j.helpers.Loader.getResource(Loader.java:91)
[hbm2java] at org.apache.log4j.LogManager.<clinit>(LogManager.java:94)
[hbm2java] at org.apache.log4j.Logger.getLogger(Logger.java:85)
[hbm2java] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229
)
[hbm2java] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hbm2java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hbm2java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[hbm2java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[hbm2java] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[hbm2java] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.
java:529)
[hbm2java] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.
java:235)
[hbm2java] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.
java:209)
[hbm2java] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[hbm2java] at net.sf.hibernate.tool.hbm2java.CodeGenerator.<clinit>(CodeGenerator.java:3
2)
[hbm2java] at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:
145)
[hbm2java] at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
[hbm2java] at org.apache.tools.ant.Task.perform(Task.java:364)
[hbm2java] at org.apache.tools.ant.Target.execute(Target.java:301)
[hbm2java] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[hbm2java] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[hbm2java] at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
[hbm2java] at org.apache.tools.ant.Main.runBuild(Main.java:632)
[hbm2java] at org.apache.tools.ant.Main.startAnt(Main.java:183)
[hbm2java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
[hbm2java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
[hbm2java] java.util.zip.ZipException: error in opening zip file
. . .
I guess that the tar file can't be opened for some reasons. What is the cause if my guess is right?
bertrand wrote:
Problem 2
The SchemaExportTask needs access to your classes - so they must be available in the classpath. Include them in the classpath of the SchemaExportTask task definition (check Ant doc for more information if needed).
Do you imply that the SchemaExportTask is depended on compiling the Java source code? I don't see such dependence relationship in the build.xml files of the examples came with the hibernate installation.