hibernate.version=3.1
xdoclet.version=1.2.3
ant.version=1.6.5
java.version=1.4.2_09
eclipse.version=3.1
A few weeks ago, I tried to use the Hibernate SchemaExport Ant task and ran into a classloader problem. I can't recall exactly what class it couldn't find - but I googled and found a number of people with the same problem. Did not find a resolution.
The problem I'm having now:
This target runs and the output says successfully, but the *.hbm.xml files are not being generated. I'll post the verbose message below the target.
Code:
<target name="generate-hbm" depends="compile" description="--> Xdoclet to build hibernate mapping file">
<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask"
classpathref="runtime.classpath" />
<hibernatedoclet destdir="${build.classes.dir}" verbose="true">
<fileset dir="${src.java.dir}">
<include name="**/*.java" />
</fileset>
</hibernatedoclet>
</target>
... verbose message
[hibernatedoclet] java.util.zip.ZipException: error in opening zip file
[hibernatedoclet] at java.util.zip.ZipFile.open(Native Method)
[hibernatedoclet] at java.util.zip.ZipFile.<init>(ZipFile.java:111)
[hibernatedoclet] at java.util.zip.ZipFile.<init>(ZipFile.java:127)
[hibernatedoclet] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
[hibernatedoclet] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hibernatedoclet] at org.apache.log4j.helpers.Loader.getResource(Loader.java:100)
[hibernatedoclet] at org.apache.log4j.LogManager.<clinit>(LogManager.java:103)
[hibernatedoclet] at org.apache.log4j.Logger.getLogger(Logger.java:103)
[hibernatedoclet] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
[hibernatedoclet] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hibernatedoclet] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hibernatedoclet] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[hibernatedoclet] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[hibernatedoclet] at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
[hibernatedoclet] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[hibernatedoclet] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[hibernatedoclet] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
[hibernatedoclet] at xdoclet.util.LogUtil.getLog(LogUtil.java:26)
[hibernatedoclet] at xdoclet.ConfigParamIntrospector.fillConfigParamsHashMapUsingReflectionFor(ConfigParamIntrospector.java:140)
[hibernatedoclet] at xdoclet.ConfigParamIntrospector.fillConfigParamsFor(ConfigParamIntrospector.java:102)
[hibernatedoclet] at xdoclet.DocletTask.getConfigParams(DocletTask.java:442)
[hibernatedoclet] at xdoclet.DocletTask.createContext(DocletTask.java:622)
[hibernatedoclet] at xdoclet.DocletTask.validateSubTasks(DocletTask.java:524)
[hibernatedoclet] at xdoclet.DocletTask.validateOptions(DocletTask.java:498)
[hibernatedoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:89)
[hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatedoclet] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatedoclet] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Thanks for your feedback.