File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes 'hibernate.dialect' must be set when no Connection available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark " Watch " New topic
Author

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

Gokhan Cakicioglu
Greenhorn

Joined: Jan 16, 2011
Posts: 4

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

Joined: Feb 18, 2006
Posts: 8
Can you please post the stack trace.
Gokhan Cakicioglu
Greenhorn

Joined: Jan 16, 2011
Posts: 4

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

Joined: Jan 16, 2011
Posts: 4

Can anybody help me please i am out of ideas. I cant find a way to solve it
Yozha Karlov
Greenhorn

Joined: Feb 14, 2011
Posts: 2
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

Joined: Feb 10, 2011
Posts: 29
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

Joined: Feb 14, 2011
Posts: 2
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: 'hibernate.dialect' must be set when no Connection available
 
Similar Threads
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Could not parse hibernate.cfg.xml
Really strange error: Could not initialize class net.sf.hibernate.impl.SessionFactoryImpl
hibernate-servlet
WebSphere 6.0 evaluation with Hibernate