ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Murdoch <adammurd...@apache.org>
Subject Re: Classloader Problems
Date Mon, 08 Apr 2002 01:35:29 GMT
On Mon, 8 Apr 2002 01:05, Roy Truelove wrote:

>
>    <target name="test" depends="compile">
>   <java classname="${current.test}">
>    <classpath>
>     <path refid="classpath.path"/>
>    </classpath>
>   </java>
>  </target>
>

The <java> task uses a specialised classloader, which basically ignores 
everything from the system classloader that is not in the java.* or javax.* 
packages.  That, of course, includes sun.jdbc.odbc.JdbcOdbcDriver.

You have a few options:

* Use fork="true" with <java> task.

* Add the JVM's rt.jar to the classpath that you pass to the <java> task.

* Change your code to load the driver class by name via the system classloader 
(since you shouldn't really be instantiating a JDBC driver directly).


-- 
Adam

--
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