When trying to reverse engineer my DB2 database tables to hbm files I get an error:
Code:
C:\hibernateTools\build.xml:71: java.lang.NoClassDefFoundError: org/hibernate/di
alect/Oracle8iDialect
at org.hibernate.cfg.MetaDataDialectFactory.fromDialect(MetaDataDialectF
actory.java:55)
at org.hibernate.cfg.MetaDataDialectFactory.createMetaDataDialect(MetaDa
taDialectFactory.java:25)
at org.hibernate.cfg.JDBCReaderFactory.newMetaDataDialect(JDBCReaderFact
ory.java:27)
at org.hibernate.cfg.JDBCReaderFactory.newJDBCReader(JDBCReaderFactory.j
ava:16)
at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:119)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:94)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaData
Configuration.java:42)
at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConf
igurationTask.java:83)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(Configurati
onTask.java:55)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateTo
olTask.java:302)
at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolT
ask.java:318)
at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.ja
va:94)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:186)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
The weird part is my hibernate.cfg.xml specifies setup for DB2:
Code:
<?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">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.password">*****</property>
<property name="hibernate.connection.url">jdbc:db2://localhost:port/myDatabase</property>
<property name="hibernate.connection.username">MyUserName</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.search.autoregister_listeners">false</property>
</session-factory>
</hibernate-configuration>
And here is my task in the ant file:
Code:
<target name="hbm" depends="prepare">
<htools destdir="${data}">
<classpath refid="tools.classpath"/>
<jdbcconfiguration configurationfile="${config}/hibernate.cfg.xml"/>
<hbm2hbmxml destdir="${src}"/>
<hbm2java destdir="${src}"/>
</htools>
</target>
Any help would be appericated.
Regards,
Steven H.