I try to generate schema using hibernate schema export, everything looks fine. But I got the following error, and an empty ddl file genarated:
Hibernate version:3.1.2
Name and version of the database you are using:MySQL 5.0.18
hibernate.config.xml: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://localhost:3306/ts</property> <property name="connection.username">user</property> <property name="connection.password">password</property> <property name="hibernate.connection.datasource">jdbc/dbs</property> <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property> <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property> <property name="hibernate.current_session_context_class">org.hibernate.context.JTASessionContext</property> <property name="show_sql">true</property> <property name="use_outer_join">true</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="jdbc.user_scrollable_resultset">false</property> <property name="jdbc.use_streams_for_binary">true</property> <property name="jdbc.batch_size">0</property> <!-- Drop and re-create the database schema on startup <property name="hbm2ddl.auto">create</property> --> <!-- mapping files --> <mapping resource="com/info/beans/ParentTree.hbm.xml" /> <mapping resource="com/info/beans/ChildTree.hbm.xml" /> </session-factory> </hibernate-configuration>
Ant target: <target name="schemaexport" depends="build"> <taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="libraries"/> <schemaexport properties="hibernate.properties" quiet="no" text="no" drop="no" delimiter=";" output="dbs.ddl"> <fileset dir="${build}"> <include name="**/*.hbm.xml"/> </fileset> </schemaexport> </target>
stack trace from ant -debug: Class java.lang.Error loaded from parent loader (parentFirst) Couldn't load ResourceStream for import.sql Couldn't load ResourceStream for import.sql .................... Class org.hibernate.connection.DriverManagerConnectionProvider loaded from ant loader (parentFirst) Finding class com.mysql.jdbc.Driver Finding class com.mysql.jdbc.Driver .............. Class org.apache.log4j.spi.VectorWriter loaded from ant loader (parentFirst)
BUILD SUCCESSFUL Total time: 2 seconds
thanks,
|