tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epr...@orpheus.fr
Subject TC7 + AntCompiler problems with whitespace in pathname
Date Mon, 16 Jan 2012 23:14:44 GMT
### Summary

TC fails to compile JSP when 1) the compiler is AntCompiler and 2) there
is a whitespace somewhere in the pathname to TC home dir.

Configuring logging.properties to have AntCompiler set to level FINEST,
logs show that:
- whitespace is translated to "%20";
- javac task fails with many errors, the first being "package
javax.servlet does not exist".

Our tests show that:
- When AntCompiler is used AND tomcat is installed in a directory whose
absolute pathname does NOT contain any whitespace, compilation is ok.
- When AntCompiler is used AND tomcat is installed in a directory whose
absolute pathname DOES contain at least one whitespace, compilation fails.
- When JDTCompiler is used, compilation is ok (whitespace or not).

This has been tested with the two environments described below (+ steps to
reproduce).

I have searched bugzilla and found nothing.


### Questions

Q1 - Does somebody already have seen this problem?
Q2 - Do you think I should fill a bug?

Thank you everybody for your help.


### Background

Q: Why not use JDTCompiler ?

A: We have at least one "huge" JSP that fails to compile with JDTCompiler
("unresolved compilation error"). When we delete code from this JSP, it
compiles. We could resolve the problem for this specific JSP but we have
not found what makes the boundary between "it compiles" and "it does not
compile" (tried suppressSmap=false, development=false). We can not afford
to deploy our application on a production server with a compiler that
might "randomly" fail on some other JSP. Previous version of our
application has always been compiled with Sun / Oracle JDK: we prefer not
to change the compiler brand. And this JSP compiles fine with Oracle JDK
(when TC is installed in a directory without any whitespace in the
absolute pathname).


### More info

Test environment #1:
- OS is Linux 32 bits (Ubuntu 10.04 LTS)
- TC is tomcat-7.0.23
- Files ant.jar + ant-launcher.jar from ant-1.8.2 copied to tomcat lib dir
- File tools.jar copied from JDK to tomcat lib dir
- "javac -version" returns
    javac 1.6.0_26
- "java -version" returns
   java version "1.6.0_26"
   Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
   Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

Test environment #2:
- OS is Windows 7 64 bits
- TC is tomcat-7.0.23
- Files ant.jar + ant-launcher.jar from ant-1.8.2 copied to tomcat lib dir
- File tools.jar copied from JDK to tomcat lib dir
- "javac.exe -version" returns
    javac 1.7.0
- "java.exe -version" returns
    java version "1.7.0"
    Java(TM) SE Runtime Environment (build 1.7.0-b147)
    Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)


### Steps to reproduce

Every test begin this way:
- Extract apache-tomcat-7.0.23.tar.gz to <SOME_DIR>, depending on test
- Add init-param compiler = javac1.7 or javac1.6 in web.xml depending on
test environment
        <init-param>
            <param-name>compiler</param-name>
            <param-value>javac1.7</param-value> <!-- or javac1.6 -->
        </init-param>
- Launch tomcat
- Go to http://localhost:8080

Tests:
- Env#1, SOME_DIR="/mnt/DSK2/tmp/tc/tc 7.0.23" => FAILS
- Env#1, SOME_DIR="/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23" => WORKS
- Env#2, SOME_DIR="C:\Users\ekp\Desktop\Work tc7\apache-tomcat-7.0.23" =>
FAILS
- Env#2, SOME_DIR="C:\tc7\apache-tomcat-7.0.23" => WORKS


### Excerpts from log file, FAIL case on environment #1

[ translation : "FIN" = fine ; "PLUS FIN" = finer / finest ; "GRAVE" =
failure ]

16 janv. 2012 23:19:12 org.apache.jasper.compiler.JspRuntimeContext
initClassPath
FIN: Compilation classpath initialized: /mnt/DSK2/tmp/tc/tc
7.0.23/work/Catalina/localhost/manager:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tools.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-dbcp.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-jdbc.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jasper-el.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ant.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-es.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ant-launcher.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/annotations-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-util.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/el-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-coyote.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jasper.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jsp-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/servlet-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-ja.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina-tribes.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-fr.jar:
 /mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina-ant.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ecj-3.7.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina-ha.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/bin/tomcat-juli.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/dnsns.jar
[...]
16 janv. 2012 23:19:18 org.apache.jasper.compiler.AntCompiler generateClass
FIN: Using classpath: /mnt/DSK2/tmp/tc/tc
7.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/tc
7.0.23/bin/tomcat-juli.jar:/mnt/DSK2/tmp/tc/tc
7.0.23/work/Catalina/localhost/_:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tools.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-dbcp.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-jdbc.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jasper-el.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ant.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-es.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ant-launcher.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/annotations-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-util.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/el-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-coyote.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jasper.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jsp-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/servlet-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-ja.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina-tribes.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-fr.jar:/mnt/D
 SK2/tmp/tc/tc%207.0.23/lib/catalina-ant.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ecj-3.7.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina-ha.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/bin/tomcat-juli.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/dnsns.jar
16 janv. 2012 23:19:18 org.apache.jasper.compiler.AntCompiler generateClass
GRAVE: Javac exception
Compile failed; see the compiler error output for details.
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1150)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:912)
        at
org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:234)
[...]
16 janv. 2012 23:19:18 org.apache.jasper.compiler.AntCompiler generateClass
GRAVE: Environment: Compile: javaFileName=/mnt/DSK2/tmp/tc/tc
7.0.23/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java
    classpath=/mnt/DSK2/tmp/tc/tc
7.0.23/work/Catalina/localhost/_:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tools.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-dbcp.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-jdbc.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jasper-el.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ant.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-es.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ant-launcher.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/annotations-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-util.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/el-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-coyote.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jasper.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jsp-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/servlet-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-ja.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-api.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina-tribes.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-i18n-fr.jar:/mnt/D
 SK2/tmp/tc/tc%207.0.23/lib/catalina-ant.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/ecj-3.7.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/lib/catalina-ha.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/tc%207.0.23/bin/tomcat-juli.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/dnsns.jar
    cp=/mnt/DSK2/tmp/tc/tc 7.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/tc
7.0.23/bin/tomcat-juli.jar
    cp=/mnt/DSK2/tmp/tc/tc 7.0.23/work/Catalina/localhost/_
    cp=/mnt/DSK2/tmp/tc/tc%207.0.23/lib
    cp=/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tools.jar
    cp=/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-dbcp.jar
    cp=/mnt/DSK2/tmp/tc/tc%207.0.23/lib/tomcat-jdbc.jar
    cp=/mnt/DSK2/tmp/tc/tc%207.0.23/lib/jasper-el.jar
[...]

### Excerpts from log file, OK case on environment #1

17 janv. 2012 00:05:49 org.apache.jasper.compiler.JspRuntimeContext
initClassPath
FIN: Compilation classpath initialized:
/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/work/Catalina/localhost/manager:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tools.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-dbcp.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-jdbc.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/jasper-el.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/ant.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-i18n-es.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/ant-launcher.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/annotations-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-util.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/el-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-coyote.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/jasper.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/jsp-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/servlet-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-i18n-ja.jar:/mnt/DSK2/tmp/tc/apache-
 tomcat-7.0.23/lib/tomcat-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina-tribes.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-i18n-fr.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina-ant.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/ecj-3.7.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina-ha.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/bin/tomcat-juli.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/dnsns.jar
[...]
17 janv. 2012 00:05:59 org.apache.jasper.compiler.AntCompiler generateClass
FIN: Using classpath:
/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/bin/tomcat-juli.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/work/Catalina/localhost/_:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tools.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-dbcp.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-jdbc.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/jasper-el.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/ant.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-i18n-es.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/ant-launcher.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/annotations-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-util.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/el-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-coyote.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/jasper.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/jsp-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.
 23/lib/servlet-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-i18n-ja.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-api.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina-tribes.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/tomcat-i18n-fr.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina-ant.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/ecj-3.7.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/lib/catalina-ha.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/bin/bootstrap.jar:/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/bin/tomcat-juli.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/dnsns.jar
17 janv. 2012 00:06:00 org.apache.jasper.compiler.AntCompiler generateClass
FIN: Compiled
/mnt/DSK2/tmp/tc/apache-tomcat-7.0.23/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java
1580ms

=*= END =*=



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message