I am trying to run middlegen through an ant task with a connection to the firebird database and i keep getting a noclassdef error
Quote:
Buildfile: build.xml
init:
fail-if-no-xdoclet-1.2:
check-driver-present:
panic-if-driver-not-present:
middlegen:
[echo] Class path = D:\Downloads\Middlegen-Hibernate-r5
[middlegen] (middlegen.Middlegen 350 ) Registering plugin simple
->middlegen.Plugin
[middlegen] (middlegen.Middlegen 350 ) Registering plugin java->
middlegen.javax.JavaPlugin
[middlegen] (middlegen.Middlegen 350 ) Registering plugin plugin
->middlegen.Plugin
[middlegen] (middlegen.Middlegen 350 ) Registering plugin hibern
ate->middlegen.plugins.hibernate.HibernatePlugin
[middlegen] Database URL:jdbc:firebirdsql:localhost/3050:C:\\APP\\Database\\ZE
E3DB.FDB
[middlegen] java.lang.NoClassDefFoundError: javax/resource/ResourceException
[middlegen] at java.lang.Class.forName0(Native Method)
[middlegen] at java.lang.Class.forName(Class.java:164)
[middlegen] at middlegen.StandardDatabase.getConnection(StandardDatabase.jav
here is the relevant section of my build file
Code:
<!-- =================================================================== -->
<!-- Run Middlegen -->
<!-- =================================================================== -->
<target
name="middlegen"
description="Run Middlegen"
unless="middlegen.skip"
depends="init,fail-if-no-xdoclet-1.2,check-driver-present,panic-if-driver-not-present"
>
<mkdir dir="${build.gen-src.dir}"/>
<echo message="Class path = ${basedir}"/>
<taskdef
name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="lib.class.path"
/>
<middlegen
appname="${name}"
prefsdir="${src.dir}"
gui="${gui}"
databaseurl="${database.url}"
initialContextFactory="${java.naming.factory.initial}"
providerURL="${java.naming.provider.url}"
driver="${database.driver}"
username="${database.userid}"
password="${database.password}"
schema="${database.schema}"
catalog="${database.catalog}"
>
<hibernate
destination="${build.gen-src.dir}"
package="${name}.hibernate"
genXDocletTags="false"
genIntergratedCompositeKeys="false"
javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
/>
</middlegen>
<mkdir dir="${build.classes.dir}"/>
</target>
And the file for loading the database and drivers
Code:
<property name="database.script.file" value=""/>
<property name="database.driver.file" value="${lib.dir}/jaybird-2.1.0.jar"/>
<property name="database.driver.classpath" value="${database.driver.file}"/>
<property name="database.driver" value="org.firebirdsql.jdbc.FBDriver"/>
<property name="database.url" value="jdbc:firebirdsql:localhost/3050:C:\\APP\\Database\\ZEE3DB.FDB"/>
<property name="database.userid" value="sysdba"/>
<property name="database.password" value="masterkey"/>
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
I believe i put the files in the correct place the directory layout is like this
the base directory is this
D:\Downloads\Middlegen-Hibernate-r5
and the jaybird driver is located here
basedir\lib\jaybird-2.1.0.jar