-->
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: Nothing Happening with <hbm2ddl>
PostPosted: Fri Oct 05, 2007 1:29 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 1:17 pm
Posts: 78
I am using Hibernate Tools for Ant v3.2B9. Here is the relevant portion of my Ant target:

Code:
<hibernateTool destdir="${ddl.dir}">

         <classpath>
            <fileset dir="${seam-hibernate.lib.dir}" includes="*.jar"/>
            <fileset dir="${hibernate.tools.lib.dir}" includes="*.jar"/>
            <fileset dir="${oracle.lib.dir}" includes="*.jar"/>
            <fileset dir="../dist" includes="*.jar"/>
         </classpath>
         <jpaconfiguration persistenceunit="standalone"/>
         <hbm2ddl export="false"
                  update="true"
                  outputfilename="db.ddl"
                  delimiter=";\n"
                  format="true"
                  haltonerror="true"/>
      </hibernateTool>


On the classpath I have all the Hibernate libraries as well as a JPA persistence archive (JAR file with persistence.xml in META-INF) and the driver to my Oracle database.

When I build the target, absolutely nothing happens. I get no error messages of any kind, and I get no DDL file produced.

Is this a bug because the version is beta, or am I doing something silly?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 07, 2007 5:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
And no logging is done either or ?

put a log4j.properties in the classpath and enable debug and show it....it should report what is missing (if anything)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 09, 2007 1:25 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 1:17 pm
Posts: 78
Well, I put log4j.properties in the classpath, and I enabled verbosity in Ant. As a result, I got a lot of information. Sadly, I am not sure what to do with it. It seems like there is some trouble opening one of the Hibernate jars.

Here it is:

Code:
Executing Hibernate Tool with a JPA Configuration
1. task: hbm2ddl (Generates database schema)
java.util.zip.ZipException: error in opening zip file
   at java.util.zip.ZipFile.open(Native Method)
   at java.util.zip.ZipFile.<init>(ZipFile.java:203)
   at java.util.zip.ZipFile.<init>(ZipFile.java:234)
   at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
   at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:126)
   at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:88)
   at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:869)
   at java.lang.ClassLoader.getResources(ClassLoader.java:1015)
   at org.apache.commons.logging.LogFactory$4.run(LogFactory.java:1317)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.apache.commons.logging.LogFactory.getResources(LogFactory.java:1336)
   at org.apache.commons.logging.LogFactory.getConfigurationFile(LogFactory.java:1398)
   at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:417)
   at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
   at org.hibernate.tool.hbm2ddl.SchemaUpdate.<clinit>(SchemaUpdate.java:29)
   at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:41)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   at org.apache.tools.ant.Task.perform(Task.java:364)
   at org.apache.tools.ant.Target.execute(Target.java:341)
   at org.apache.tools.ant.Target.performTasks(Target.java:369)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   at org.apache.tools.ant.Main.runBuild(Main.java:668)
   at org.apache.tools.ant.Main.startAnt(Main.java:187)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource META-INF/services/org.apache.commons.logging.LogFactory from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
java.util.zip.ZipException: error in opening zip file
   at java.util.zip.ZipFile.open(Native Method)
   at java.util.zip.ZipFile.<init>(ZipFile.java:203)
   at java.util.zip.ZipFile.<init>(ZipFile.java:234)
   at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
   at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
   at org.apache.log4j.helpers.Loader.getResource(Loader.java:96)
   at org.apache.log4j.LogManager.<clinit>(LogManager.java:103)
   at org.apache.log4j.Logger.getLogger(Logger.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.commons.logging.impl.Log4jProxy.<init>(Log4jProxy.java:145)
   at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:288)
   at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:91)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
   at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
   at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
   at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
   at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
   at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
   at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
   at org.hibernate.tool.hbm2ddl.SchemaUpdate.<clinit>(SchemaUpdate.java:29)
   at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:41)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   at org.apache.tools.ant.Task.perform(Task.java:364)
   at org.apache.tools.ant.Target.execute(Target.java:341)
   at org.apache.tools.ant.Target.performTasks(Target.java:369)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   at org.apache.tools.ant.Main.runBuild(Main.java:668)
   at org.apache.tools.ant.Main.startAnt(Main.java:187)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)
java.util.zip.ZipException: error in opening zip file
   at java.util.zip.ZipFile.open(Native Method)
   at java.util.zip.ZipFile.<init>(ZipFile.java:203)
   at java.util.zip.ZipFile.<init>(ZipFile.java:234)
   at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
   at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
   at org.apache.log4j.helpers.Loader.getResource(Loader.java:96)
   at org.apache.log4j.LogManager.<clinit>(LogManager.java:105)
   at org.apache.log4j.Logger.getLogger(Logger.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.commons.logging.impl.Log4jProxy.<init>(Log4jProxy.java:145)
   at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:288)
   at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:91)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
   at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
   at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
   at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
   at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
   at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
   at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
   at org.hibernate.tool.hbm2ddl.SchemaUpdate.<clinit>(SchemaUpdate.java:29)
   at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:41)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   at org.apache.tools.ant.Task.perform(Task.java:364)
   at org.apache.tools.ant.Target.execute(Target.java:341)
   at org.apache.tools.ant.Target.performTasks(Target.java:369)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   at org.apache.tools.ant.Main.runBuild(Main.java:668)
   at org.apache.tools.ant.Main.startAnt(Main.java:187)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)
log4j:WARN No appenders could be found for logger (org.hibernate.ejb.Version).
log4j:WARN Please initialize the log4j system properly.
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource hibernate.properties from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
java.util.zip.ZipException: error in opening zip file
   at java.util.zip.ZipFile.open(Native Method)
   at java.util.zip.ZipFile.<init>(ZipFile.java:203)
   at java.util.zip.ZipFile.<init>(ZipFile.java:234)
   at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
   at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:126)
   at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:88)
   at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:869)
   at java.lang.ClassLoader.getResources(ClassLoader.java:1015)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:198)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.hibernate.tool.ant.JPAConfigurationTask.createConfiguration(JPAConfigurationTask.java:37)
   at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:54)
   at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:299)
   at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:41)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   at org.apache.tools.ant.Task.perform(Task.java:364)
   at org.apache.tools.ant.Target.execute(Target.java:341)
   at org.apache.tools.ant.Target.performTasks(Target.java:369)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   at org.apache.tools.ant.Main.runBuild(Main.java:668)
   at org.apache.tools.ant.Main.startAnt(Main.java:187)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource gov/nist/srm/persistence/EntityBase.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource gov/nist/srm/persistence/admin/User.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource ValidatorMessages.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource ValidatorMessages.properties from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource ValidatorMessages_en.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource ValidatorMessages_en.properties from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource ValidatorMessages_en_US.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource ValidatorMessages_en_US.properties from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource org/hibernate/event/EventListenersBeanInfo.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource org/hibernate/util/CloneableBeanInfo.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties



Any insight is appreciated. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 10, 2007 3:10 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
looks like you put the actual log4j.properties into the classpath; you should just list the directory - not the actual file.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 10, 2007 2:59 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 1:17 pm
Posts: 78
Sorry, I must have misunderstood what you said earlier. I put log4j.properties into the directory called "${hibernate.tools.lib.dir}," in the target mentioned above, in order to enable logging. I did not list the file specifically in the Ant target. I kept the target the same with the file in the Hibernate Tools directory.

When you say "you should just list the directory," I thought that is what I did. Can you please clarify further?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 10, 2007 3:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource gov/nist/srm/persistence/EntityBase.class from C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties

indicates you added C:\srm\libs\seam-hibernate\hibernate-tools\log4j.properties to the classpath instead of C:\srm\libs\seam-hibernate\hibernate-tools\ which would be the right way making a resource available on a path.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 13, 2007 4:17 am 
Regular
Regular

Joined: Fri Oct 05, 2007 1:17 pm
Posts: 78
I really don't mean to sound terribly foolish, but that is precisely what I did at the beginning. I did in fact use C:\srm\libs\seam-hibernate\hibernate-tools\ to make the resource available on the path. I did so with the following in the Ant script:

<fileset dir="${hibernate.tools.lib.dir}" includes="*.jar"/>

This directory contains all the libraries in the Hibernate Tools download--all JAR files. It is included in the classpath element that is a child of <hbm2ddl>.

Doing that avoids the errors in the stack trace I posted earlier, but it also leads me to receive no feedback of any kind when I run hbm2ddl. Well, I do get the usual log4j initialization errors:

log4j:WARN Please initialize the log4j system properly.
log4j:WARN No appenders could be found for logger

I suppose I need to solve a log4j question before I can even worry about why hbm2ddl is unresponsive. Do I place a log4j JAR file in the ${hibernate.tools.lib.dir} ? Where do I place log4j.properties if not in ${hibernate.tools.lib.dir}?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 13, 2007 4:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
If i put a log4j.properties into the classpath I don't

log4j:WARN Please initialize the log4j system properly.
log4j:WARN No appenders could be found for logger

So for some reason log4j is not seeing the log4j.properties.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 13, 2007 6:48 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 1:17 pm
Posts: 78
I have tried to get log4j to find log4j.properties within the Ant task. I have added the following to the Ant command line:

Code:
-Dlog4j.debug
-Dlog4j.configuration=file:///C:\srm\logging\log4j.properties


I assure you this is the right location.

Still, I get the following:

Code:
log4j:WARN No appenders could be found for logger (org.hibernate.ejb.Version).
log4j:WARN Please initialize the log4j system properly.


Though this may be irrelevant at this stage since the file cannot be found, just in case here are the contents of the log4j.properties file (ripped off from the file that comes with the download except added more debug levels):

Code:
### This file is used to control the logging done by the hibernate tools eclipse plugins
### You can modfiy these to be more or less verbose depending on your needs

### Direct messages to Eclipse logging system (will be shown in Error Log)
log4j.appender.eclipselog=org.hibernate.eclipse.logging.PluginLogAppender
log4j.appender.eclipselog.layout=org.apache.log4j.PatternLayout
log4j.appender.eclipselog.layout.ConversionPattern=%d{ISO8601} %p %t %c - %m

### Direct messages from Eclipse loggin system to .metadata/plugins/org.hibernate.eclipse/hibernate-tools.log
log4j.appender.pluginlog=org.hibernate.eclipse.logging.PluginFileAppender
log4j.appender.pluginlog.File=hibernate-tools.log
log4j.appender.pluginlog.MaxFileSize=1MB
log4j.appender.pluginlog.MaxBackupIndex=1
log4j.appender.pluginlog.layout=org.apache.log4j.PatternLayout
log4j.appender.pluginlog.layout.ConversionPattern=%d{ISO8601} %-6r [%15.15t] %-5p %30.30c %x - %m\n

### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=debug, eclipselog, pluginlog

log4j.logger.org.hibernate=debug

# Disable superflous PARSER errors.
log4j.logger.org.hibernate.PARSER=none

### log just the SQL
#log4j.logger.org.hibernate.SQL=debug

### log JDBC bind parameters ###
#log4j.logger.org.hibernate.type=debug

### log schema export/update ###
#log4j.logger.org.hibernate.tool.hbm2ddl=debug

### log cache activity ###
#log4j.logger.org.hibernate.cache=debug

### log JDBC resource acquisition
#log4j.logger.org.hibernate.jdbc=debug

### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace


Any idea why log4j isn't finding its configuration?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2007 2:54 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 1:17 pm
Posts: 78
OK, so I figured out the logging and even some dialect issues. Now the task seems to work great!

Except...I get no output file and no table generated.

Here is the task:

Code:
<target name="createDB">
      <ant antfile="build-persistence-jar.xml" target="jar"/>
      <hibernateTool destdir="${ddl.dir}">
         <classpath>
            <fileset dir="${seam-hibernate.lib.dir}" includes="*.jar"/>
            <fileset dir="${hibernate.tools.lib.dir}" />
            <fileset dir="${oracle.lib.dir}" includes="*.jar"/>
            <fileset dir="../dist" includes="*.jar"/>
         </classpath>
         <jpaconfiguration persistenceunit="srmStandalone"/>
         <hbm2ddl export="true"
                  update="true"
                  outputfilename="srm.sql"
                  delimiter=";"
                  format="true"
                  haltonerror="true" destdir="${ddl.dir}"/>
      </hibernateTool>
</target>


Here is the logging output:

Code:
Executing Hibernate Tool with a JPA Configuration
1. task: hbm2ddl (Generates database schema)
Oct 17, 2007 2:22:17 PM org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.2.0.GA
Oct 17, 2007 2:22:17 PM org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.2.0.GA
Oct 17, 2007 2:22:17 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.1
Oct 17, 2007 2:22:17 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Oct 17, 2007 2:22:17 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
Oct 17, 2007 2:22:17 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Oct 17, 2007 2:22:18 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: findUserByUsername => from User as user where user.username = :username
Oct 17, 2007 2:22:18 PM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: gov.nist.srm.persistence.admin.User
Oct 17, 2007 2:22:18 PM org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity gov.nist.srm.persistence.admin.User on table APP_USER
Oct 17, 2007 2:22:18 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.Oracle9Dialect
Oct 17, 2007 2:22:18 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: Running hbm2ddl schema update
Oct 17, 2007 2:22:18 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: fetching database metadata
Oct 17, 2007 2:22:18 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Oct 17, 2007 2:22:18 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
Oct 17, 2007 2:22:18 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: true
Oct 17, 2007 2:22:19 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@server:port:sid
Oct 17, 2007 2:22:19 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=USER, password=****, autocommit=true, release_mode=auto}
Oct 17, 2007 2:22:19 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: updating schema
Oct 17, 2007 2:22:20 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Oct 17, 2007 2:22:20 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
Oct 17, 2007 2:22:20 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: true
Oct 17, 2007 2:22:20 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@sysdev.nist.gov:2001:sysdev
Oct 17, 2007 2:22:20 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=USER, password=****, autocommit=true, release_mode=auto}
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: Oracle, version: Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.7.0 - Production
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: Oracle JDBC driver, version: 11.1.0.6.0-Production
Oct 17, 2007 2:22:20 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.Oracle9Dialect
Oct 17, 2007 2:22:20 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
Oct 17, 2007 2:22:20 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
Oct 17, 2007 2:22:20 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: enabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
Oct 17, 2007 2:22:20 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Oct 17, 2007 2:22:21 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: SRM_ADMIN.SRM_USER
Oct 17, 2007 2:22:21 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [username, role, created_by_user_id, date_created, id, version]
Oct 17, 2007 2:22:21 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk28884b9cd4f2b429]
Oct 17, 2007 2:22:21 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [sys_c0045709]
Oct 17, 2007 2:22:21 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: schema update complete
Oct 17, 2007 2:22:21 PM org.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:oracle:thin:@server:port:sid


Any ideas?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2007 6:02 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 1:17 pm
Posts: 78
My mistake. The table was generated, which is great. But I still do not get an output file. So I can still use some help!

Thanks.


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.