Hi,
    JspC error while doing PreCompilation,
    I 'am using ant 1.6.2 and tomcat 5. When I call jspc from ant it is 
thworing invaid  cast exception.  In JspRunTimeContext class. It is getting the 
current thread classloader  and casting to URL classloader..
 
parentClassLoader = 
(URLClassLoader)Thread.currentThread().getContextClassLoader();
This is because Thread.currentThread().getContextClassLoader() is returning 
AntClassLoader.
which is incompatible with URLClassLoader. Hence thrwoing ClassCastException.
 
The detail exception is, Please don't consider the line number in the below 
stack Trace.
The code thrwoing the exception is above given in bold font of 
org.apache.jasper.compiler.JspRuntimeContext class.
 
 
    [java] java.lang.ClassCastException
    [java]     at 
org.apache.jasper.compiler.JspRuntimeContext.<init>(JspRuntimeContext.java:46)
    [java]     at org.apache.jasper.JspC.initServletContext(JspC.java:866)
    [java]     at org.apache.jasper.JspC.execute(JspC.java:735)
    [java]     at org.apache.jasper.JspC.main(JspC.java:71)
    [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java]     at java.lang.reflect.Method.invoke(Method.java:324)
    [java]     at 
org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:193)
    [java]     at 
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:130)
    [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:705)
    [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:177)
    [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:83)
    [java]     at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    [java]     at org.apache.tools.ant.Task.perform(Task.java:364)
    [java]     at org.apache.tools.ant.Target.execute(Target.java:341)
    [java]     at org.apache.tools.ant.Target.performTasks(Target.java:369)
    [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
    [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
    [java]     at org.apache.tools.ant.Main.runBuild(Main.java:673)
    [java]     at org.apache.tools.ant.Main.startAnt(Main.java:188)
    [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
    [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
 
 
I 'am stuck up in this, This is a class loader issue. It would be a great help 
if anybody has a solution for this. After this exception, there is a code to 
set current thread class loader to URL classLoader in JspC.java.
 
Regards,
Jagga
 
 
 
 

                
---------------------------------
Do you Yahoo!?
 Yahoo! Search presents - Jib Jab's 'Second Term'

Reply via email to