ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Ruff <Marcel.R...@avitech-ag.com>
Subject SystemClassLoader fails to load inside my own ant task
Date Tue, 18 Apr 2006 21:20:43 GMT
Hi,

i'm using ANT 1.6.5 on Linux (same for JDK 1.4 or 1.5).

I have written an own task, inside this i use
java.util.logging.
When i want to load my own logging handler it fails:

[xmlBlasterScript] java.lang.ClassNotFoundException: 
org.xmlBlaster.util.log.XbNotifyHandler
[xmlBlasterScript]      at 
java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[xmlBlasterScript]      at 
java.security.AccessController.doPrivileged(Native Method)
[xmlBlasterScript]      at 
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[xmlBlasterScript]      at 
java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[xmlBlasterScript]      at 
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
[xmlBlasterScript]      at 
java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[xmlBlasterScript]      at 
java.util.logging.LogManager$5.run(LogManager.java:783)
...

The java.util.logging.LogManager.java uses following code:

  Class clz = ClassLoader.getSystemClassLoader().loadClass(word);

It seems the system class loader does not find my XbNotifyHandler class
even that it is definitely in the CLASSPATH,
i have also tried
  <typedef >
  <classpath> <pathelement location="..."

with no success.

But this is works fine:
  Class clz = 
Thread.currentThread().getContextClassLoader().loadClass(cname);

but i can't change the java.util.logging code to use the ContextClassLoader!

How can i resolve this issue?

thanks
Marcel






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


Mime
View raw message