Re: JspC exception with log4j in WEB-INF/lib
But as soon as I put log4j-1.2.9.jar into my WEB-INF/lib directory, it doesn't work any more. I get the following exception: [jasper2] java.lang.NullPointerException [jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:220) After building a version of Tomcat which logs the exception that happens when trying to create the compiler (by default it's caught without logging), I was able to figure out how to fix it. Apparently, when log4j-1.2.9.jar is in WEB-INF/lib, it also needs to be in the ant/lib directory (or somewhere else in the Ant classpath). If it isn't there, a ClassNotFound exception will be thrown when trying to create the compiler (either Ant or JDT), but this exception is caught without logging and later the NullPointer exception happens. As a side effect, I discovered that the same goes for jasper-compiler-jdt.jar. The JDT compiler will not be used unless it's in the Ant classpath. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JspC exception with log4j in WEB-INF/lib
I'm trying to use the Jspc ant task to precompile JSP pages. It's almost working except for one problem. I made a minimal webapp, with the usual structure, and just one empty JSP file. The task runs fine and compiles the JSP without problems. But as soon as I put log4j-1.2.9.jar into my WEB-INF/lib directory, it doesn't work any more. I get the following exception: [jasper2] java.lang.NullPointerException [jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:220) [jasper2] at org.apache.jasper.JspC.processFile(JspC.java:849) [jasper2] at org.apache.jasper.JspC.execute(JspC.java:991) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [jasper2] at java.lang.reflect.Method.invoke(Method.java:585) [jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:157) [jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306) [jasper2] at org.apache.tools.ant.Task.perform(Task.java:401) [jasper2] at org.apache.tools.ant.Target.execute(Target.java:338) [jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:365) [jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java:1237) [jasper2] at org.apache.tools.ant.Project.executeTargets(Project.java:1094) [jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:669) [jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:220) [jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215) [jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90) [jasper2] Error in class org.apache.jasper.JspC I tried different versions of log4j, without success. Any other jar files don't bother Jspc, but as soon as I put log4j in WEB-INF/lib, I get this exception. The funny thing is, WEB-INF/lib isn't even in the classpath of the JspC task. And if I put log4j in ${tomcat.home}/common/lib (which is in the classpath), I don't get the exception. Well, I can't figure it out... anybody know why this could be happening? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JspC exception with log4j in WEB-INF/lib [255729:132231]
Many thanks for your email. This is an automated response acknowledging receipt. Please be advised that Badge mailing commences beginning of October 2005. Should your message require a response we will respond shortly. Regards Meridian Club -Original Message- From: Artur Brinkmann [EMAIL PROTECTED] Received: 10/7/2005 2:27 PM To: tomcat-user@jakarta.apache.org Subject: JspC exception with log4j in WEB-INF/lib I'm trying to use the Jspc ant task to precompile JSP pages. It's almost working except for one problem. I made a minimal webapp, with the usual structure, and just one empty JSP file. The task runs fine and compiles the JSP without problems. But as soon as I put log4j-1.2.9.jar into my WEB-INF/lib directory, it doesn't work any more. I get the following exception: [jasper2] java.lang.NullPointerException [jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:220) [jasper2] at org.apache.jasper.JspC.processFile(JspC.java:849) [jasper2] at org.apache.jasper.JspC.execute(JspC.java:991) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [jasper2] at java.lang.reflect.Method.invoke(Method.java:585) [jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:157) [jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306) [jasper2] at org.apache.tools.ant.Task.perform(Task.java:401) [jasper2] at org.apache.tools.ant.Target.execute(Target.java:338) [jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:365) [jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java:1237) [jasper2] at org.apache.tools.ant.Project.executeTargets(Project.java:1094) [jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:669) [jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:220) [jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215) [jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90) [jasper2] Error in class org.apache.jasper.JspC I tried different versions of log4j, without success. Any other jar files don't bother Jspc, but as soon as I put log4j in WEB-INF/lib, I get this exception. The funny thing is, WEB-INF/lib isn't even in the classpath of the JspC task. And if I put log4j in ${tomcat.home}/common/lib (which is in the classpath), I don't get the exception. Well, I can't figure it out... anybody know why this could be happening? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Meridian Club Unit 5, Caxton Centre Porters Wood St Albans Herts UNITED KINGDOM AL3 6XT Tel: +44 1727 738855 Fax: +44 1700 578955 email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JspC exception
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'
JSPC exception
I'm getting this error when I invoke a page with custom tags. I can refresh the page until all custom tags are compiled and everything works fine. Any ideas? org.apache.jasper.Jasper: Unable to compile class for JSPC:\Apache Tomcat 4.0\webapps\codesmith\WEB-INF\lib\codesmith.jar(codesmith/server/taglib/java /JavaDocTag.java): Public class codesmith.server.taglib.java.JavaDocTag must be defined in a file called JavaDocTag.java. -Matt -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Jspc exception.
I apologize if this has been covered before; I searched the archives and couldn't find an solution. I'm running Tomcat 3.2.4 on linux. When attempting to precompile JSPs with jspc.sh -webxml, I receive this exception: Exception in thread main java.lang.ArrayIndexOutOfBoundsException at org.apache.jasper.JspC.parseFiles(JspC.java:437) at org.apache.jasper.JspC.main(JspC.java:689) FYI, running jspc.bat with Tomcat 3.2.1 on Windows 2000 worked ok. Can anyone point me in the right direction, or perhaps an archive posting that has already covered this? Thanks in advance, Sean -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]