ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <levylamb...@tiscali-dsl.de>
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
Sun.
I have to put these two jar files in my classpath before starting ant, otherwise my build
fails.
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 :
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17576
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6606

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 ?

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