tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rolf Schumacher <>
Subject calling ant launcher
Date Sat, 08 Apr 2006 18:51:38 GMT
Dear Tomcat professionals,

I tried to automate some installation over the Web
I got a class cast exception when trying to launch Ant from a servlet.
The program works fine if I execute it from the command line.
In a servlet under Tomcat it causes a


I looked up line 275 in

270        URLClassLoader loader = new URLClassLoader(jars);
271        Thread.currentThread().setContextClassLoader(loader);
272        Class mainClass = null;
273        try {
274             mainClass = loader.loadClass(MAIN_CLASS);
275            AntMain main = (AntMain) mainClass.newInstance();
276            main.startAnt(newArgs, null, null);

Do you have an idea why the loader does load something different
that usually can be casted to AntMain?

Any help appreaciated.


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

View raw message