ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject class loading problems/class.forName()
Date Thu, 22 May 2003 11:33:29 GMT
I have the following problem :
Environment : JDK 1.4, Win2000
I am developing some custom ant tasks, which are using MQ Series for Java.
The custom ant tasks use fscontext.jar and providerutil.jar, two JNDI jar files supplied by
I have to put these two jar files in my classpath before starting ant, otherwise my build
set CLASSPATH=%MQ_JAVA_INSTALL_PATH%\lib\fscontext.jar;%MQ_JAVA_INSTALL_PATH%\lib\providerutil.jar
Classes contained in these two jar files are almost certainly instantiated in a class of jndi.jar
with a call of Class.forName()
Is there a workaround to avoid having to set the classpath manually ? I do not have problems
with other classes which are not loaded via Class.forName.
I have found these two bug reports which are maybe related to what I experience :

Would scripting calls to AntClassLoader#forceLoadClass in my build script solve the problem
? If yes, does someone have an example of how to do it ? Or would a workaround be to run the
java task beforehand, giving it as main class the jndi driver name for instance ?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message