-->
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: Ant is unable to find Hibernate.dialect property
PostPosted: Wed Jun 08, 2005 12:38 pm 
Newbie

Joined: Fri May 27, 2005 1:02 am
Posts: 6
I'm using WebLogic 8.1 appserver and Oracle 10g as database.
When I try to generate the schema from my mappnig xmls, the Export tool is unable to find the hibernate.dialect property irrespective fo the fact that i have set the property both in ant script as well as the config file.

This issue is posted at one other post in forum, but there was no answer, so i tried my luck again here. Details attached below

Hibernate version:
version 3.0.5
Mapping documents (hibernate config xml):
<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:@tf-server.geotel.net:1521:orcl</property>
<property name="hibernate.connection.username">hiberappuser</property>
<property name="hibernate.connection.password">jaknap</property>
<property name="show_sql">true</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

<mapping resource="Classes.hbm.xml"/>

</session-factory>

</hibernate-configuration>
Ant file (had added full paths in here, for testing):

<project name="Create DB" default="init-db" basedir=".">
<path id="build.classpath">
<pathelement location="C:/WorkSpace/MyWork/Hibernate/Utilities/lib/hibernate3.jar"/>
<pathelement location="C:/WorkSpace/MyWork/Hibernate/Utilities/lib/commons-logging-1.0.4.jar"/>
</path>

<target name="init-db">
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<taskdef classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
name="schemaexport">
<classpath refid="build.classpath"/>
</taskdef>
<schemaexport
delimiter=";"
drop="false"
output="schema.sql"
properties="hibernate.cfg.xml"
quiet="false"
text="false">
<fileset dir="C:/WorkSpace/MyWork/Hibernate/Utilities">
<include name="**/*.hbn.xml"/>
</fileset>
</schemaexport>
</target>


</project>

Full stack trace of any exception that occurs:

Buildfile: build.xml

init-db:
[schemaexport] Jun 8, 2005 10:01:01 PM org.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: Hibernate 3.0.5
[schemaexport] Jun 8, 2005 10:01:01 PM org.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: hibernate.properties not found
[schemaexport] Jun 8, 2005 10:01:01 PM org.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: using CGLIB reflection optimizer
[schemaexport] Jun 8, 2005 10:01:01 PM org.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: using JDK 1.4 java.sql.Timestamp handling

BUILD FAILED
file:C:/WorkSpace/MyWork/Hibernate/Utilities/build.xml:21: Schema text failed: T
he dialect was not set. Set the property hibernate.dialect.

Total time: 0 seconds

Name and version of the database you are using:
Oracle 10g


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 12:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Its not finding you Hibernate.cfg.xml need to get the path right for it.
BTW: The ant task does not need the extra property for the dialect. Just need to find the xml configuration file.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 11:11 am 
Newbie

Joined: Fri May 27, 2005 1:02 am
Posts: 6
Thanks David,

The correct path for the file made it work :)..thanxx again

For any other beginenrs like me, who ar facing similar issues, this tut: http://www.hibernate.org/291.html turned out to be really helpful. (The only addition i had to do was to add the classes directory to the classpath)


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.