-->
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: org.hibernate.HibernateException: The dialect was not set.
PostPosted: Mon Nov 28, 2005 5:31 am 
Newbie

Joined: Mon Nov 28, 2005 4:56 am
Posts: 4
Hi group.

I am Seenu , new to hibernate, trying to learn hibernate. While executing hibernate 3.0 example. i am getting following exception.

###############################################

D:\hibernate-3.0>build eg

D:\hibernate-3.0>set JDBC_DRIVER=lib/jdbc.jar

D:\hibernate-3.0>java -cp "lib/ant-launcher-1.6.2.jar" org.apache.tools.ant.launch.Launcher -lib lib -Ddriver.jar=lib/jdbc.ja
r eg
Buildfile: build.xml
[taskdef] Could not load definitions from resource checkstyletask.properties. It could not be found.
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

eg:
[echo] remember to place your JDBC driver in the lib directory
[java] 12:28:51,433 INFO Environment:460 - Hibernate 3.0
[java] 12:28:51,448 INFO Environment:478 - loaded properties from resource hibernate.properties: {hibernate.cglib.use_r
eflection_optimizer=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'}
[java] 12:28:51,448 INFO Environment:506 - using CGLIB reflection optimizer
[java] 12:28:51,464 INFO Environment:536 - using JDK 1.4 java.sql.Timestamp handling
[java] 12:28:51,542 INFO Configuration:460 - Mapping resource: org/hibernate/auction/AuctionItem.hbm.xml
[java] 12:28:52,089 INFO HbmBinder:258 - Mapping class: org.hibernate.auction.AuctionItem -> AuctionItem
[java] 12:28:52,214 INFO Configuration:460 - Mapping resource: org/hibernate/auction/Bid.hbm.xml
[java] 12:28:52,276 INFO HbmBinder:258 - Mapping class: org.hibernate.auction.Bid -> Bid
[java] 12:28:52,339 INFO HbmBinder:736 - Mapping subclass: org.hibernate.auction.BuyNow -> Bid
[java] 12:28:52,339 INFO Configuration:460 - Mapping resource: org/hibernate/auction/User.hbm.xml
[java] 12:28:52,386 INFO HbmBinder:258 - Mapping class: org.hibernate.auction.User -> AuctionUser
[java] 12:28:52,401 INFO Configuration:851 - processing extends queue
[java] 12:28:52,401 INFO Configuration:855 - processing collection mappings
[java] 12:28:52,401 INFO HbmBinder:1953 - Mapping collection: org.hibernate.auction.AuctionItem.bids -> Bid
[java] 12:28:52,401 INFO HbmBinder:1953 - Mapping collection: org.hibernate.auction.User.bids -> Bid
[java] 12:28:52,401 INFO HbmBinder:1953 - Mapping collection: org.hibernate.auction.User.auctions -> AuctionItem
[java] 12:28:52,417 INFO Configuration:864 - processing association property references
[java] 12:28:52,433 INFO Configuration:893 - processing foreign key constraints
[java] Exception in thread "main" org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.
dialect.
[java] at org.hibernate.dialect.Dialect.getDialect(Dialect.java:477)
[java] at org.hibernate.dialect.Dialect.getDialect(Dialect.java:499)
[java] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:51)
[java] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1505)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1053)
[java] at org.hibernate.auction.Main.main(Main.java:364)

BUILD FAILED
D:\hibernate-3.0\build.xml:620: Java returned: 1

Total time: 3 seconds

###############################################

As of my understanding its throwing exception as i have not set the dialect property. But i have set it in my hibernate.cft.xm. file.

Can anyone tell where exactly i need to set the dialect property?

it would be of great help.

With Thanks and Regards
Seenu


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 28, 2005 6:45 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
You have it set in the hibernate.cfg.xml? Well, I suppose hibernate it's not finding it because of this:
Code:
[java] 12:28:51,448 INFO Environment:478 - loaded properties from resource hibernate.properties: {hibernate.cglib.use_r
eflection_optimizer=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'}


I think it's looking for the dialect in hibernate.properties.

Try this on hibernate.properties:
Code:
hibernate.dialect org.hibernate.dialect.FirebirdDialect


Of course, put your correct dialect.

:)

_________________
Don't forget to rate if the post helped!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 28, 2005 6:47 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
you are running the examples? there is a hibernate.properties file in there somewhere - it needs to be in 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.