ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Lebek <>
Subject custom ant task: referencing to external classes
Date Tue, 19 Aug 2003 09:17:14 GMT
I wrote a task, that connects to a database using JDBC. The JDBC 
interfaces like javax.sql.DataSource are part of J2EE. Therefore, I 
included "j2ee.jar" into the classpath of the task:

<path id="test.classpath">
   <pathelement location="${lib}"/>
   <fileset dir="${lib}">             <!-- this is where
                                           j2ee.jar is located
     <include name="**/*.jar"/>
   <fileset dir="${task.lib}">        <!-- this is where
                                           my task is located
     <include name="**/*.jar"/>

<taskdef name="mytask" classpathref="test.classpath"/>

On executing "mytask" it shows the follwoing error message:

java.lang.NoClassDefFoundError: javax/sql/DataSource

I inserted a System.err.println(System.getProperty("java.class.path")) 
to my task. The output shows the system classpath only. If the task 
would use this classpath, it could not even have found its own class, 
because it is not on the system classpath.

I do not want to put j2ee.jar on the system classpath. What else can I do?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message