Hibernate version:
Hibernate version3.0
Hi,
My hibernate.cfg.xml looks something like the following:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@10.130.30.37:10920:widev</property>
<property name="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>
<!-- Mapping files -->
<mapping resource="Message.hbm.xml"/>
</session-factory>
</hibernate-configuration>
My build.xml when I use schema export utility looks something like:
<target name="init-db" description="Creates the app database.">
<taskdef classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="project.class.path"
name="schemaexport"/>
<schemaexport delimiter=";" drop="no" output="${basedir}/sql/oracle/generated/hbSchema.sql"
config="${class.destdir}/hibernate.cfg.xml" quiet="no" text="no">
</schemaexport>
<fileset dir="${basedir}">
<include name="**/*.hbm.xml"/>
</fileset>
<echo message="hibernate config file found in ${class.destdir}/hibernate.cfg.xml"/>
</target>
where I have defined project.class.path and class.destdir. But when I try to run build.xml init-db I am getting the following errors. Could you please tell me why??
Buildfile: C:\eclipse-SDK-3.0.1-win32\eclipse\workspace\Hibernate_Test\src\build.xml
init-db:
[schemaexport] - Hibernate 3.0 beta 2
[schemaexport] - hibernate.properties not found
[schemaexport] - using CGLIB reflection optimizer
[schemaexport] - using JDK 1.4 java.sql.Timestamp handling
[schemaexport] - configuring from file: hibernate.cfg.xml
[schemaexport] - Mapping resource: Message.hbm.xml
[schemaexport] - Mapping class: com.webmd.bna.hello.Message -> AC_MESSAGES
[schemaexport] - Could not perform validation checks for component as the class com.webmd.bna.hello.Message was not found
[schemaexport] - Configured SessionFactory: null
[schemaexport] - Using dialect: org.hibernate.dialect.OracleDialect
[schemaexport] - processing extends queue
[schemaexport] - processing collection mappings
[schemaexport] - processing association property references
[schemaexport] - processing foreign key constraints
[schemaexport] - reflection optimizer disabled for: com.webmd.bna.hello.Message, BulkBeanException: Property is private (property setId)
[schemaexport] - processing extends queue
[schemaexport] - processing collection mappings
[schemaexport] - processing association property references
[schemaexport] - processing foreign key constraints
[schemaexport] - reflection optimizer disabled for: com.webmd.bna.hello.Message, BulkBeanException: Property is private (property setId)
[schemaexport] - reflection optimizer disabled for: com.webmd.bna.hello.Message, BulkBeanException: Property is private (property setId)
[schemaexport] - reflection optimizer disabled for: com.webmd.bna.hello.Message, BulkBeanException: Property is private (property setId)
[schemaexport] - reflection optimizer disabled for: com.webmd.bna.hello.Message, BulkBeanException: Property is private (property setId)
[schemaexport] - Running hbm2ddl schema export
[schemaexport] - writing generated schema to file: C:\eclipse-SDK-3.0.1-win32\eclipse\workspace\Hibernate_Test\src/sql/oracle/generated/hbSchema.sql
[schemaexport] - exporting generated schema to database
[schemaexport] - No connection properties specified - the user must supply JDBC connections
[schemaexport] - schema export unsuccessful
[schemaexport] java.lang.UnsupportedOperationException: The user must supply a JDBC connection
[schemaexport] at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:30)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:123)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:86)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:142)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:377)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
[echo] hibernate config file found in ../classes/hibernate.cfg.xml
BUILD SUCCESSFUL
Total time: 3 seconds
|