-->
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.  [ 11 posts ] 
Author Message
 Post subject: Cant get HibernateTool ant task to work
PostPosted: Sat Mar 04, 2006 8:59 pm 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
I have been trying for several hours to get this to work.
Read all of your documentation but can't find what's wrong or a sample working build.xml + build.properties for it.
The hibernatetool ant task gets created and invoked. So I have the correct JAR files in my class path.
But I cant get none of the child tasks to work, such as hbm2hbmxml or hbm2dao.
All of them give the error:
"[hibernatetool] java.util.zip.ZipException: error in opening zip file"
A full log in included bellow.

I send both build.xml and properties file along with the normal info that applies...


Hibernate version: 3 (Hibernate tools 3.1.0 beta4)



Script files: build.xml
Code:
<?xml version="1.0"?>

<project default="main" basedir=".">
<property file="build.properties"/>
   
   <target name="main" depends="prepare, generate"/>

   <target name="prepare">
      
      <taskdef name="hibernatetool"
              classname="org.hibernate.tool.ant.HibernateToolTask">
         <classpath>
            <fileset dir="${hibernate.tools.dir}">
               <include name="**/*.jar" />
            </fileset>
            <fileset dir="${hibernate.libs.annotations}">
               <include name="**/*.jar" />
            </fileset>
            <fileset dir="${hibernate.libs.dir}">
               <include name="**/*.jar" />
            </fileset>
            <fileset dir="${hibernate.libs.lib}">
               <include name="**/*.jar" />
            </fileset>
            <fileset dir="${lib.dir}">
               <include name="**/*.jar" />
            </fileset>
            <pathelement location="${hibernate.log4j.properties}"/>
         </classpath>
      </taskdef>
      
      <hibernatetool destdir="${build.classes.dir}"
                    templatepath="${template.dir}">
         <jdbcconfiguration configurationfile="hibernate.cfg.xml"
                        revengfile="hibernate.reveng.xml"/>
         <property key="jdk5" value="true"/>
         <property key="ejb3" value="false"/>

         <!--hbm2hbmxml destdir="${build.classes.dir}"/-->
   
         <hbm2dao destdir="${build.classes.dir}"/>
   
         <!--hbmtemplate destdir="${build.classes.dir}" templateprefix="dao/" template="templates/dao/daohome.vm" filepattern="{package-name}/{class-name}Home.java"/-->
         <!--hbmtemplate destdir="${build.classes.dir}" templateprefix="pojo/" template="templates/pojo/Pojo.vm" filepattern="{package-name}/{class-name}.java"/-->
         <!--hbmtemplate destdir="${build.classes.dir}" templateprefix="pojo/" template="templates/pojo/PojoInterface.vm" filepattern="{package-name}/{class-name}I.java"/-->
      </hibernatetool>
   </target>
   
   <target name="generate" >
   </target>
    
</project>




Script files: build.properties
Code:
build.classes.dir=${basedir}/../src/com/teamware/delegateit/model/test
template.dir=${basedir}/templates

eclipse.dir=F:/Programming/Java/JBoss IDE
hibernate.plugin.dir=${eclipse.dir}/plugins/org.hibernate.eclipse_3.1.0.beta4
hibernate.tools.dir=${hibernate.plugin.dir}/lib/tools
hibernate.libs.lib=${hibernate.plugin.dir}/lib
hibernate.libs.dir=${hibernate.plugin.dir}/lib/hibernate
hibernate.libs.annotations=${hibernate.plugin.dir}/lib/annotations
hibernate.log4j.properties=${hibernate.plugin.dir}/hibernate-log4j.properties
lib.dir=${basedir}/../lib




Full stack trace of any exception that occurs:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2dao (Generates a set of DAOs)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool] at java.util.zip.ZipFile.open(Native Method)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:818)
[hibernatetool] at org.apache.log4j.helpers.Loader.getResource(Loader.java:87)
[hibernatetool] at org.apache.log4j.LogManager.<clinit>(LogManager.java:103)
[hibernatetool] at org.apache.log4j.Logger.getLogger(Logger.java:103)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
[hibernatetool] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[hibernatetool] at org.hibernate.tool.hbm2x.POJOExporter.<clinit>(POJOExporter.java:19)
[hibernatetool] at org.hibernate.tool.ant.Hbm2DAOExporterTask.createExporter(Hbm2DAOExporterTask.java:22)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool] at java.util.zip.ZipFile.open(Native Method)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hibernatetool] at org.apache.log4j.helpers.Loader.getResource(Loader.java:100)
[hibernatetool] at org.apache.log4j.LogManager.<clinit>(LogManager.java:103)
[hibernatetool] at org.apache.log4j.Logger.getLogger(Logger.java:103)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
[hibernatetool] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[hibernatetool] at org.hibernate.tool.hbm2x.POJOExporter.<clinit>(POJOExporter.java:19)
[hibernatetool] at org.hibernate.tool.ant.Hbm2DAOExporterTask.createExporter(Hbm2DAOExporterTask.java:22)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool] at java.util.zip.ZipFile.open(Native Method)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:818)
[hibernatetool] at org.apache.log4j.helpers.Loader.getResource(Loader.java:87)
[hibernatetool] at org.apache.log4j.LogManager.<clinit>(LogManager.java:105)
[hibernatetool] at org.apache.log4j.Logger.getLogger(Logger.java:103)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
[hibernatetool] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[hibernatetool] at org.hibernate.tool.hbm2x.POJOExporter.<clinit>(POJOExporter.java:19)
[hibernatetool] at org.hibernate.tool.ant.Hbm2DAOExporterTask.createExporter(Hbm2DAOExporterTask.java:22)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool] at java.util.zip.ZipFile.open(Native Method)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hibernatetool] at org.apache.log4j.helpers.Loader.getResource(Loader.java:100)
[hibernatetool] at org.apache.log4j.LogManager.<clinit>(LogManager.java:105)
[hibernatetool] at org.apache.log4j.Logger.getLogger(Logger.java:103)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
[hibernatetool] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[hibernatetool] at org.hibernate.tool.hbm2x.POJOExporter.<clinit>(POJOExporter.java:19)
[hibernatetool] at org.hibernate.tool.ant.Hbm2DAOExporterTask.createExporter(Hbm2DAOExporterTask.java:22)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool] at java.util.zip.ZipFile.open(Native Method)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hibernatetool] at java.lang.Class.getResource(Unknown Source)
[hibernatetool] at oracle.sql.ConverterArchive.readObj(ConverterArchive.java:289)
[hibernatetool] at oracle.sql.converter.CharacterConverter.getInstance(CharacterConverter.java:141)
[hibernatetool] at oracle.sql.CharacterSetWithConverter.getInstance(CharacterSetWithConverter.java:77)
[hibernatetool] at oracle.sql.CharacterSetFactoryThin.make(CharacterSetFactoryThin.java:95)
[hibernatetool] at oracle.sql.CharacterSet.make(CharacterSet.java:370)
[hibernatetool] at oracle.jdbc.dbaccess.DBConversion.<init>(DBConversion.java:116)
[hibernatetool] at oracle.jdbc.ttc7.TTCConversion.<init>(TTCConversion.java:85)
[hibernatetool] at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1728)
[hibernatetool] at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:215)
[hibernatetool] at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:360)
[hibernatetool] at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
[hibernatetool] at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
[hibernatetool] at java.sql.DriverManager.getConnection(Unknown Source)
[hibernatetool] at java.sql.DriverManager.getConnection(Unknown Source)
[hibernatetool] at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
[hibernatetool] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
[hibernatetool] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1877)
[hibernatetool] at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:58)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:179)
[hibernatetool] at org.hibernate.tool.ant.Hbm2DAOExporterTask.createExporter(Hbm2DAOExporterTask.java:22)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool] at java.util.zip.ZipFile.open(Native Method)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at java.util.zip.ZipFile.<init>(Unknown Source)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
[hibernatetool] at java.lang.Class.getResource(Unknown Source)
[hibernatetool] at oracle.sql.ConverterArchive.readObj(ConverterArchive.java:289)
[hibernatetool] at oracle.sql.converter.CharacterConverter.getInstance(CharacterConverter.java:141)
[hibernatetool] at oracle.sql.CharacterSetWithConverter.getInstance(CharacterSetWithConverter.java:77)
[hibernatetool] at oracle.sql.CharacterSetFactoryThin.make(CharacterSetFactoryThin.java:95)
[hibernatetool] at oracle.sql.CharacterSet.make(CharacterSet.java:370)
[hibernatetool] at oracle.jdbc.dbaccess.DBConversion.<init>(DBConversion.java:116)
[hibernatetool] at oracle.jdbc.ttc7.TTCConversion.<init>(TTCConversion.java:85)
[hibernatetool] at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1728)
[hibernatetool] at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:215)
[hibernatetool] at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:360)
[hibernatetool] at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
[hibernatetool] at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
[hibernatetool] at java.sql.DriverManager.getConnection(Unknown Source)
[hibernatetool] at java.sql.DriverManager.getConnection(Unknown Source)
[hibernatetool] at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
[hibernatetool] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
[hibernatetool] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1877)
[hibernatetool] at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:38)
[hibernatetool] at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:73)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:179)
[hibernatetool] at org.hibernate.tool.ant.Hbm2DAOExporterTask.createExporter(Hbm2DAOExporterTask.java:22)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
generate:
main:
BUILD SUCCESSFUL
Total time: 5 seconds

_________________
Pedro Viegas


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 1:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
do not put a non zip/jar file such as a hibernate.properties in the classpath.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 12:37 pm 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
Thanks Max. It works now.
But having removed the log4j properties file I get...

Code:
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.


How do we provide the log4j file to hibernatetool?
Have searched the forum but can't find a solution posted.
Have tried to put the file in the same dir of the ant script but it doesn't work either.

Thanks in advance.

_________________
Pedro Viegas


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
as you do with any resource in a classpath.

if the file is at c:/x/y/z/log4j.properties you put c:/x/y/z in the classpath.

btw. in the beta version the exception message handling is better (as it also prints a message to ant logger so it should be more usable ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 2:55 pm 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
OK, I think I get it, but this is still far from hover...

1st of all: log4j
I Added log4j.properties (witch is a copy of the hibernate-log4j.properties from the HibernateTools eclipse plugin) and got the errors bellow...

I ask you this. Since i'm not running inside eclipse I must remove those...
log4j.appender.eclipselog=org.hibernate.eclipse.logging.PluginLogAppender
log4j.appender.eclipselog.layout=org.apache.log4j.PatternLayout
...and others?
What sould my log4j.properties have? Is there a default one I can use somewhere?
And I still get these...

[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.

The ant output is bellow...

2nd: Some properties are not set. How to do it?
The POJOs generated have: "// default package" instead of the package name. Somehow I have to set the package name. How can I do it.
I'm sure somewhere there is documentation showing all of these questions. I'm feeling like trying to find a needle in a hay stack! Could you give a hand to get this to work?



Thanks a million for helping me with this.
I feel I'm right arround the corner.
I can allready generate all of my objects. Just a few pointers and I'm there.

Code:
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] log4j:ERROR Could not instantiate class [org.hibernate.eclipse.logging.PluginLogAppender].
[hibernatetool] java.lang.ClassNotFoundException: org.hibernate.eclipse.logging.PluginLogAppender
[hibernatetool] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1166)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1107)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:977)
[hibernatetool] at java.lang.ClassLoader.loadClass(Unknown Source)
[hibernatetool] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[hibernatetool] at java.lang.Class.forName0(Native Method)
[hibernatetool] at java.lang.Class.forName(Unknown Source)
[hibernatetool] at org.apache.log4j.helpers.Loader.loadClass(Loader.java:169)
[hibernatetool] at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:317)
[hibernatetool] at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:120)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:629)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
[hibernatetool] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
[hibernatetool] at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
[hibernatetool] at org.apache.log4j.Logger.getLogger(Logger.java:103)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
[hibernatetool] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.<init>(AbstractExporter.java:25)
[hibernatetool] at org.hibernate.tool.hbm2x.HibernateMappingExporter.<init>(HibernateMappingExporter.java:30)
[hibernatetool] at org.hibernate.tool.ant.Hbm2HbmXmlExporterTask.createExporter(Hbm2HbmXmlExporterTask.java:17)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] log4j:ERROR Could not instantiate appender named "eclipselog".
[hibernatetool] log4j:ERROR Could not instantiate class [org.hibernate.eclipse.logging.PluginFileAppender].
[hibernatetool] java.lang.ClassNotFoundException: org.hibernate.eclipse.logging.PluginFileAppender
[hibernatetool] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1166)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1107)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:977)
[hibernatetool] at java.lang.ClassLoader.loadClass(Unknown Source)
[hibernatetool] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[hibernatetool] at java.lang.Class.forName0(Native Method)
[hibernatetool] at java.lang.Class.forName(Unknown Source)
[hibernatetool] at org.apache.log4j.helpers.Loader.loadClass(Loader.java:169)
[hibernatetool] at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:317)
[hibernatetool] at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:120)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:629)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
[hibernatetool] at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
[hibernatetool] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
[hibernatetool] at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
[hibernatetool] at org.apache.log4j.Logger.getLogger(Logger.java:103)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
[hibernatetool] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[hibernatetool] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[hibernatetool] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[hibernatetool] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
[hibernatetool] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.<init>(AbstractExporter.java:25)
[hibernatetool] at org.hibernate.tool.hbm2x.HibernateMappingExporter.<init>(HibernateMappingExporter.java:30)
[hibernatetool] at org.hibernate.tool.ant.Hbm2HbmXmlExporterTask.createExporter(Hbm2HbmXmlExporterTask.java:17)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] log4j:ERROR Could not instantiate appender named "pluginlog".
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] 2. task: hbm2java (Generates a set of .java files)
[hibernatetool] 3. task: generic exporter
[hibernatetool] 4. task: generic exporter
[hibernatetool] 5. task: generic exporter
main:
BUILD SUCCESSFUL
Total time: 10 seconds

_________________
Pedro Viegas


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 3:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the hibernate-log4j.properties is for running inside eclipse where we pipe log messages to eclipse log and vice versa.

It just need to be any log4j compatible property file.

Here is a basic log4j.properties based on what is in hibernate core etc directory:

### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

log4j.rootLogger=warn, stdout

log4j.logger.org.hibernate=info

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 4:05 pm 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
Perfect Max!
Log4J working like a charm!
Solved most of my problems meanwhile, just one little detail to go...

Quote:
2nd: Some properties are not set. How to do it?
The POJOs generated have: "// default package" instead of the package name. Somehow I have to set the package name. How can I do it.
I'm sure somewhere there is documentation showing all of these questions. I'm feeling like trying to find a needle in a hay stack! Could you give a hand to get this to work?


Where does the $pojo.getPackageDeclaration() in Pojo.vm gets its value from?

_________________
Pedro Viegas


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 6:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
<jdbcconfiguration package="blablah" ...>

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 6:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
p.s. jdbcconfiguration package is just to tell the reveng what the default pacakge should be and that is then put into the hibernate mapping model and it is from there $pojo.getPackageDeclaration() gets it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 7:18 pm 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
Thanks again!
Everything 100% Everything gets generated perfectly with all the new methods and classes/interfaces I've added!

Thanks a million Max.

And by the way... keep up the good work with the great tool you've created!
Hibernate Tools rocks!

_________________
Pedro Viegas


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 1:06 pm 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
Just a minor correction...

max wrote:
<jdbcconfiguration package="blablah" ...>


Is...

<jdbcconfiguration packagename="blablah" ...>

Regards,

_________________
Pedro Viegas


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