Hi! What a subject!

I've trying to make work starting up Tomcat with jsvc.
On Debian unstable, this works ok.
On Debian stable (woody), I could startup Tomcat, but when I try to access to a JSP file, I get the classic exception:


2004-07-12 02:03:58 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.io.FileNotFoundException: /home/horacio/tomcat-pruebas-startup/jakarta-tomcat-5.0.25/work/Catalina/localhost/prueba/org/apache/jsp/test_jsp.java
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188)


This isn't a permission problems, I've checked them a hundred times, I've excecute 'chown -R USER.USER jakarta-tomcat-dir' many times too.

I've follow the instructions on Tomcat FAQ, and I've tryed
http://jakarta.apache.org/tomcat/faq/misc.html#commonsLoggingLog4j
http://marc.theaimsgroup.com/?l=tomcat-user&m=108330970225012&w=2
http://marc.theaimsgroup.com/?l=tomcat-user&m=108578233003073&w=2

and couldn't make it work on Debian stable (woody).

I was looking at 'generateJava()' on file org.apache.jasper.compiler.Compiler.java (line 188), this is what make the exception:

try {
  osw = new OutputStreamWriter(     // <- LINE 188
   new FileOutputStream(javaFileName), javaEncoding);

} catch (UnsupportedEncodingException ex) {
errDispatcher.jspError("jsp.error.needAlternateJavaEncoding",
                javaEncoding);
}

So, I make a little java program using FileOutputStream.

public static void main(String[] args) throws Exception {
FileOutputStream fos = new FileOutputStream("/tmp/dir/that/doesnt/exist/test.txt");
byte test[] = new byte[1024];
fos.write(test);
fos.close();
}


Since "/tmp/dir/that/doesnt/exist" doesn't existe, I get the exact same exception:

java.io.FileNotFoundException:
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:70)



And then, I've tried to make the directories that Tomcat needs to make the temporary .java, so I do:

mkdir -p /home/horacio/tomcat-pruebas-startup/jakarta-tomcat-5.0.25/work/Catalina/localhost/prueba/org/apache/jsp

and then, reloaded the page, and this work!!!!!

So, the only problem is that Tomcat doesn't make the proper directory structure where it should put the generated .java...

So:
 - If I run Tomcat from "startup.sh"       -> WORKS
 - If I run Tomcat from "jsvc" on UNSTABLE -> WORKS
 - If I run Tomcat from "jsvc" on STABLE   -> DOESN'T WORKS

ON DEBIAN UNSTABLE:
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

ON DEBIAN STABLE:
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

ALSO ON DEBIAN STABLE:
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Tomcat 5.0.25

Is this a bug?
How can I make work Tomcat on Debian stable with jsvc?

Thanks in advance!

Horacio de Oro


*********

Full error message from tomcat's logs.


2004-07-12 02:03:58 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.io.FileNotFoundException: /home/horacio/tomcat-pruebas-startup/jakarta-tomcat-5.0.25/work/Catalina/localhost/prueba/org/apache/jsp/test_jsp.java
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:461)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Thread.java:534)


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



Reply via email to