Re: JspC exception with log4j in WEB-INF/lib

2005-10-10 Thread Artur Brinkmann
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

2005-10-07 Thread Artur Brinkmann
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]

2005-10-07 Thread RTE - Meridian Club
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]