Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'hibernate.dialect' must be set when no Connection available

 
Gokhan Cakicioglu
Greenhorn
Posts: 4
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I started to learn hibernate for 2 days. Everything was going ok until i got this damned error message whatever i do i couldnt fix it. I google it all 2 days but couldnt understand the solution. Is there anybody in here to help my problem. Here is my configuration file:

<?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="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">pass</property>
<property name="hibernate.connection.url">jdbcracle:thin:@localhost:1521:xe</property>
<property name="hibernate.connection.username">Gokhan</property>
<property name="hibernate.default_schema">GOKHAN</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<mapping resource="student\OgrenciNot.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Help will be tooo mucchly appreciated.

and i am using hibernate3 and eclipse ide and oracle xe as you can understand from the conf file
 
Muddassar Shaikh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please post the stack trace.
 
Gokhan Cakicioglu
Greenhorn
Posts: 4
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the console output. First 3 row is about logging i guess and i think it isnt soo important.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:106)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:152)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
at student.ShowTime.main(ShowTime.java:16)
 
Gokhan Cakicioglu
Greenhorn
Posts: 4
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me please i am out of ideas. I cant find a way to solve it
 
Yozha Karlov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem. Damn exception makes me crazy. I use latest hibernate (3.6) oracle xe g10, eclipse j2ee helios. I want to use JPA and hibernate as provider. So this is my persistence.xml



The output is " org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available"
 
Samrat Gadamsetty
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this thread as he has updated his sql-driver and he got luck there... try (I think) to update the oracle driver..

cheers..
samrat
 
Yozha Karlov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, i've forgot to add that i'm using Spring integration. So probem was solved when I maked db property initialization in bean of class "org.apache.commons.dbcp.BasicDataSource"

Like this


So when this propertis are set programmaticly, not in persistence.xml, exception isn't occured.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic