Bug 55620 - When using startup.bat if apache-tomcat-7.0.xx is in directory with "," (comma) or ";" (semi-colon) Tomcat fails to start
When using startup.bat if apache-tomcat-7.0.xx is in directory with "," (comm...
Status: RESOLVED WONTFIX
Product: Tomcat 8
Classification: Unclassified
Component: Catalina
trunk
PC All
: P2 minor (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-10-02 16:36 UTC by Rodney Beede
Modified: 2013-10-10 19:34 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodney Beede 2013-10-02 16:36:43 UTC
When using startup.bat if apache-tomcat-7.0.xx is in directory with "," (comma) or ";" (semi-colon) Tomcat fails to start correctly

Example:

C:\Users\username\Desktop\Some Parent\Another parent with, a comma\apache-tomcat-7.0.42\

cd "C:\Users\username\Desktop\Some Parent\Another parent with, a comma\apache-tomcat-7.0.42"

cd bin

set java_home=c:\Program Files\java\jre7

startup.bat


You get the catalina log attached at the end.

If there is a semi-colon then you get no log at all.


Most likely the Windows batch scripts for startup need to better handle escaping directory paths.  The error isn't clear as to the cause.  A work-around is to move the apache-tomcat-7.0.xx to a full pathname with NO commas or semi-colons.



catalina log:

Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with], exists: [false], isDirectory: [false], canRead: [false]
Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with, a comma\apache-tomcat-7.0.42\bin\a comma\apache-tomcat-7.0.42\lib], exists: [false], isDirectory: [false], canRead: [false]
Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with], exists: [false], isDirectory: [false], canRead: [false]
Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with, a comma\apache-tomcat-7.0.42\bin\a comma\apache-tomcat-7.0.42\lib], exists: [false], isDirectory: [false], canRead: [false]
Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with], exists: [false], isDirectory: [false], canRead: [false]
Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with, a comma\apache-tomcat-7.0.42\bin\a comma\apache-tomcat-7.0.42\lib], exists: [false], isDirectory: [false], canRead: [false]
Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with], exists: [false], isDirectory: [false], canRead: [false]
Oct 02, 2013 11:34:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [C:\Users\username\Desktop\Some Parent\Another parent with, a comma\apache-tomcat-7.0.42\bin\a comma\apache-tomcat-7.0.42\lib], exists: [false], isDirectory: [false], canRead: [false]
Comment 1 Mark Thomas 2013-10-07 09:58:00 UTC
Comma causes problems because Tomcat uses it as a separator in .loader properties in catalina.properties.

Semi-colon causes problems because it is the separator for class path entries on Windows.

Colon will probably cause a problem on non-Windows platforms as it is used as the class path separator there.
Comment 2 Mark Thomas 2013-10-07 10:57:01 UTC
I'm moving this to Tomcat 8 as I don't think there is sufficient demand from the user community for this feature in Tomcat 7 and there is a small chance that the changes necessary to support it will break something.

I have fixed the comma case for 8.0.x and this will be include in 8.0.0-RC4 onwards. I'm still looking at semi-colon and colon.
Comment 3 Mark Thomas 2013-10-07 12:47:37 UTC
Having dug through the OpenJDK code there is no way Tomcat can support ; or ; in CATALINA_HOME and CATRALINA_BASE as the JRE doesn't provide any mechanism for quoting ; or : so they can't be distinguished from path separators.

I'm resolving this as WONTFIX to make clear that elements of this bug can't - therefore won't - be fixed.
Comment 4 Christopher Schultz 2013-10-07 13:39:23 UTC
It might be worth doing a check in catalina.bat and catalina.sh for those characters in either of CATALINA_HOME or CATALINA_BASE, and refusing to even attempt to start under those conditions.

Any objections?
Comment 5 Mark Thomas 2013-10-07 13:51:21 UTC
None here.
Comment 6 Mark Thomas 2013-10-10 11:07:58 UTC
Checks added.
Comment 7 Christopher Schultz 2013-10-10 19:34:28 UTC
Aw. I had a patch waiting to be committed.

Mine would have worked under Cygwin, too ;)