ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Breedveld" <jero...@x-hive.com>
Subject Odd behaviour loaderref attribute taskdef and typedef
Date Fri, 03 Jan 2003 09:52:34 GMT
Hi all,

I wrote some custom anttasks for use with the database of our company.
To make sure that the custom tasks and types are loaded with the same
classloader I used the loaderref attribute to supply ant with a
reference to the same classloader. The problem is that when I supply the
loaderref attribute with the same name as the project (see code snippet
below) different classloaders are used to load the custom tasks and
types (that's my conclusion because I receive ClassCastExceptions).
Changing to values of the loaderref attribute to anything else solves
this problem. Is this a bug or did I do something wrong?

regards,

Jeroen Breedveld

code snippet:

<project name="3dm" default="build" basedir=".">

  <target name="init">
    <property file="build.properties"/>
    <path id="classpath">
      <path location="../build"/>
      <fileset dir="${xhive.dir}/build/lib">
        <include name="xhive.jar"/>
        <include name="dom3_intermediate.jar"/>
      </fileset>
      <fileset dir="${xhive.dir}/lib">
        <include name="**/*.jar"/>
      </fileset>
      <fileset dir="../lib">
        <include name="**/*.jar"/>
      </fileset>
    </path>
    <taskdef loaderref="3dm"
              resource="com/xhive/anttasks/tasks.properties"
          classpathref="classpath"/>
    <typedef loaderref="3dm"
              resource="com/xhive/anttasks/type.properties"
          classpathref="classpath"/>
    <database id="MyDatabase"
       bootstrap="${bootstrap}"
            name="${database}"
            user="${user}"
        password="${password}"/>
  </target>

--

X-Hive Corporation
e-mail: jeroenb@x-hive.com
phone: +31 10 7108622
http://www.x-hive.com 

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message