-->
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.  [ 3 posts ] 
Author Message
 Post subject: Newbie trying to get middlegen to connect to firebird
PostPosted: Tue Aug 01, 2006 9:32 pm 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 06, 2006 7:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Your missing 'connector.jar' - firebird JDBC driver must require it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 6:43 pm 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
You were correct, I realized i was using the wrong driver i switched to the jaybird Full driver and it started working.

Thankyou


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