-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem with JPA with Hibernate + Oracle and Firebird
PostPosted: Sat Jul 07, 2007 12:51 pm 
Newbie

Joined: Sat Jul 07, 2007 12:20 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
I need help: Error ocorred something with Firebird.

[b]Hibernate version:hibernate3

[b]Full stack trace of any exception that occurs:
Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set for database: Interbase
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory (Ejb3Configuration.java:698)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at siace.web.teste.TesteOracle.main(TesteOracle.java:25)
Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set for database: Interbase
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:62)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect (SettingsFactory.java:409)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1216)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691)
... 4 more


My code in persistence.xml
<persistence-unit name="analisePU"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.connection.driver_class"
value=" oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.connection.username"
value="xxxxxx" />
<property name="hibernate.connection.password "
value="aaaaaaaa" />
<property name="hibernate.connection.url"
value="jdbc:oracle:thin:@172.30.9.66:1521:siace01" />
<property name=" hibernate.connection.dialect"
value="org.hibernate.dialect.Oracle9Dialect" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>

<persistence-unit name="remessaPU"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.connection.driver_class"
value="org.firebirdsql.jdbc.FBDriver" />
<property name=" hibernate.connection.username"
value="sysdba" />
<property name="hibernate.connection.password"
value="masterkey" />
<property name=" hibernate.connection.url"
value="jdbc:firebirdsql:localhost/3050:C:\\master.gdb" />
<property name="hibernate.connection.dialect"
value=" org.hibernate.dialect.FirebirdDialect" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>

</persistence>


Obs: The database oracle no have problem.

Tanks

Marcelo

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject: Is persistence.xml in your classpath?
PostPosted: Sat Jul 07, 2007 1:34 pm 
Newbie

Joined: Tue Nov 01, 2005 3:07 pm
Posts: 7
When the application is ran, it looks for META-INF/persistence.xml in the classpath. Make sure your META-INF/persistence.xml is accessible at runtime.

If this is a stand-alone project, with the output stored in folder "bin", copy the META-INF directory into "bin".

If this is a web-application, make sure your WAR file has META-INF/persistence.xml in it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 5:22 pm 
Newbie

Joined: Sat Jul 07, 2007 12:20 pm
Posts: 2
My project is stand-alone. It is correct. Folder META-INF stay into directory bin.

The problem stay in application.

Tank's


Top
 Profile  
 
 Post subject: Hope this is it...
PostPosted: Sun Jul 08, 2007 6:54 pm 
Newbie

Joined: Tue Nov 01, 2005 3:07 pm
Posts: 7
Hi again,

There seems to be an extra space at the beginning of:

value=" org.hibernate.dialect.FirebirdDialect" />

Try removing it. Otherwise, if this isn't it, everything looks fine to me.

Hope this solves your problem!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.