-->
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.  [ 2 posts ] 
Author Message
 Post subject: weird ant jdbcconfiguration action
PostPosted: Wed Sep 29, 2010 5:05 pm 
Newbie

Joined: Wed Sep 29, 2010 4:54 pm
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: weird ant jdbcconfiguration action
PostPosted: Thu Sep 30, 2010 2:24 pm 
Newbie

Joined: Wed Sep 29, 2010 4:54 pm
Posts: 2
I found my problem! Don't know why but when I updated my hibernate from 3.2 to 3.3.2, added some missing jars: jtidy-r8-20060801.jar, asm-3.3.jar, javassist-3.9.0.GA, all seems to be working fine. Here is my final target definition incase it might be useful to someone:

Code:
<target name="hbm" depends="prepare">
      <htools destdir="${data}">
      <classpath refid="tools.classpath"/>
         <jdbcconfiguration configurationfile="${config}/hibernate.cfg.xml"
                        packagename="${mypackage}"
                        revengfile="${revend}/hibernate.reveng.xml"/>
            <hbm2hbmxml destdir="${data}"/>
            <hbm2java ejb3="true" destdir="${data}"/>
      </htools>
   </target>


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