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

java.lang.ClassCastException: org.apache.tools.ant.Main
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:275)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:96)

I looked up line 275 in Launcher.java:

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.

Rolf


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to