The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

shruti (1) [Avatar] Offline
#1
I have created a hibernate implementing simple example using eclipse and i am getting this problem.

og4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:37smilie
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:110)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
at com.capco.hibernate.HibernateDemo.main(HibernateDemo.java:17)


Can anybody help me solving this problem.
Sobhen (16) [Avatar] Offline
#2
Re: "Hibernate Dialect must be explicitly set" error occured
Check the hibernate.cfg.xml file wheather u have configured the dialect correctly.
It should be like this
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

In my case it is org.hibernate.dialect.Oracle9Dialect. But it depends on the database u are using.

Also check the valid dialect lists from hibernate.jar.

Also make sure that following jars are in ur classpath.
hibernate3.jar
dom4j-1.6.1.jar
commons-logging-1.0.4.jar
commons-collections-2.1.1.jar
cglib-2.1.3.jar
asm-attrs.jar
jta.jar
asm.jar
antlr-2.7.6.jar

If it helps then let me know.
sshlkmrmanning@gmail.com (2) [Avatar] Offline
#3
Re: "Hibernate Dialect must be explicitly set" error occured
i am also getting same as shruti

og4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)

i have <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

also
sshlkmrmanning@gmail.com (2) [Avatar] Offline
#4
Re: "Hibernate Dialect must be explicitly set" error occured
i am also getting same as shruti

og4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)

i have <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

also

please give me solution