hello,
I'm Hibernate-Newbee and trying to explore all the great things that shall be possible .. and seem to stuck at a trivial problem - but not trivial for me :-(
I'm using
- Eclipse 3.1
- Hibernate Synchronizer 3.1.1 Eclipse Plugin
- Hibernate 3.1
- java SDK 1.5
- SAP DB 7.4
- Windows 2K
installed all - as described in various tutorials - begun creating my first Test Implementation The Eclipse Hibernate Synchronizer Plugin finds my test-DB and generates the hbm.xml, cfg and class files. WOW !
All looks fine, compiling succeeds, I start the Test and ... oops .. get the following error-message
Code:
Exception in thread "main" 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:378)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:110)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1830)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1150)
at FirstHibernating.main(FirstHibernating.java:27)
ok !
I check the configuration file(s) and finde two of them:
config.properties: (generated by Hibernate Synchronizer)
Code:
package=db
ConfigFile=\\HiberTest\\src\\db\\hibernate.cfg.xml
databaseUrl=jdbc:sapdb://localhost/testdb01
driver=com.sap.dbtech.jdbc.DriverSapDB
SourceLocation=\\HiberTest\\src
username=test1
dialect=org.hibernate.dialect.SAPDBDialect
hibernate.cfg.xml: (generated by Hibernate Synchronizer)
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory >
<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:sapdb://localhost/testdb01</property>
<property name="hibernate.connection.driver_class">com.sap.dbtech.jdbc.DriverSapDB</property>
<property name="hibernate.connection.username">test1</property>
<property name="hibernate.connection.password">test1</property>
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for SAP DB -->
<property name="dialect">org.hibernate.dialect.SAPDBDialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
</session-factory>
</hibernate-configuration>
Both contain a "dialect=org.hibernate.dialect.SAPDBDialect" entry. So
after all it seems, as if Hibernate does not really read (at least one) of these files. I've copied it to nearly every possible (sensful) location e.a. Hibernate home dir, Hibernate lib dir, application bin dir, etc.
Even if I put some senseless text into the configuration files, no error message or something like that appears - that shows me: hibernate does not use these files.
My questions:
- how can I find out, where to put the config files ?
- how can I parametrize hibernate to put a certain file-location? (I've already checked the classpath - locations )
- Is this my problem at all, or has anybody another idea, what the problem could be ??
I've googled the whole Internet .. but the above exception seems to be seldom - in other words : my problem seems to be only my problem :-/
if anybody can help
please let me know
many thanks in advance
.rf.