I want to export shema for my test application, but I have every time the same error: the Dialect class can not be found!!! Here is my command line and the error message:
Code:
C:\Temp\export>SchemaExport.bat --output=my_shema_file.ddl --properties=hibernate.properties Person.hbm.xml
22.04.2004 09:48:39 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.2
22.04.2004 09:48:39 net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connection.username=student,
hibernate.connection.password=geheim, hibernate.cglib.use_reflection_optimizer=true,
hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect,
hibernate.connection.url=jdbc:postgresql://localhost/export_db, hibernate.connection.driver_class=org.postgresql.Driver}
22.04.2004 09:48:39 net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
22.04.2004 09:48:39 net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: Person.hbm.xml
22.04.2004 09:48:41 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: Person -> t_personen
22.04.2004 09:48:42 net.sf.hibernate.tool.hbm2ddl.SchemaExport main
SCHWERWIEGEND: Error creating schema
net.sf.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.PostgreSQLDialect
at net.sf.hibernate.dialect.Dialect.getDialect(Dialect.java:380)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:57)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:297)
net.sf.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.PostgreSQLDialect
at net.sf.hibernate.dialect.Dialect.getDialect(Dialect.java:380)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:57)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:297)
The
hibernate2.jar it in the class path. And, Iadapted the
SchemaExport.bat too as follow:
Code:
@echo off
rem -------------------------------------------------------------------
rem Execute SchemaExport tool
rem -------------------------------------------------------------------
set JDBC_DRIVER=F:\Dev\Java\JdbcDrivers\pg73jdbc3.jar;F:\Dev\Java\JdbcDrivers\hsqldb.jar
set HIBERNATE_HOME=F:\Dev\hibernate-2.1
set LIB=%HIBERNATE_HOME%\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=.;%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-logging-1.0.3.jar;%LIB%\commons-collections-2.1.jar;%LIB%\commons-lang-1.0.1.jar;%LIB%\cglib-2.0-rc2.jar;%LIB%\dom4j-1.4.jar;%LIB%\odmg-3.0.jar;%LIB%\xml-apis.jar;%LIB%\xerces-2.4.0.jar;%LIB%\xalan-2.4.0.jar
java -cp %CP% net.sf.hibernate.tool.hbm2ddl.SchemaExport %*
What could be the reason for this error message? Is my command line wrong?
Thanks