-->
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.  [ 3 posts ] 
Author Message
 Post subject: hibernate.cfg.xml
PostPosted: Fri Apr 01, 2005 6:13 pm 
Newbie

Joined: Wed Mar 30, 2005 12:09 pm
Posts: 10
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 6:48 pm 
Newbie

Joined: Thu May 05, 2005 5:49 pm
Posts: 11
Location: San Diego, California
I am getting the same thing. Were you ever able to find the cause of this?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 3:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
could it be you have not set the connection provider to anything else than UserProvidedConnection ?

_________________
Max
Don't forget to rate


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