You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/04/20 20:25:41 UTC

DO NOT REPLY [Bug 53115] New: catalina.bat run does not work is TEMP contains spaces

https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

             Bug #: 53115
           Summary: catalina.bat run does not work is TEMP contains spaces
           Product: Tomcat 7
           Version: 7.0.23
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: eugene.petrenko@jetbrains.com
    Classification: Unclassified


Under clean Windows XP, under Administrator account. 
Default temp dir is like c:\Documents and Settings\Admin\Local Settings\TEMP

In catalina.bat there is a temp dir check:
if ""%TEMP%"" == """" goto mainEntry

Actually, this command does not work if TEMP contains spaces. 
The right line is:
if ""%TEMP%"" == """" goto mainEntry

i.e. to avoid double quoting

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #4 from Sebb <se...@apache.org> ---
AFAICT it's not possible using IF because one cannot get past the syntax error
that occurs when the quotes are mismatched.

However, I think I've found a solution.

Try the following:

REM The output of ECHO will be :: if TEMP is not defined
REM It's not possible for :: to be found within a valid TEMP variable
echo :%TEMP%: | find "::"
REM check for level 0, i.e. pattern found
if NOT ERRORLEVEL 1 goto mainEntry

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


DO NOT REPLY [Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

--- Comment #2 from Eugene Petrenko <eu...@jetbrains.com> 2012-04-22 15:00:41 UTC ---
There is a known issue under XP
http://social.technet.microsoft.com/Forums/zh/itproxpsp/thread/a4f428ba-1826-46a0-999a-972ae4279fbe

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

--- Comment #9 from Konstantin Kolinko <kn...@gmail.com> ---
(In reply to comment #3)

I think %TEMP% do not use quotes, like ones are not used in %PATH%.
The OS cares that %TEMP% do not contain spaces, and thus it would not be
quoted.

You naturally do not use quotes when you configure values through GUI.
The syntax for SET command is less intuitive. For reference:

SET "TEMP=value"


[Offtopic] Regarding that thread on social.technet.microsoft.com I would say
that
- The value of NtfsDisable8dot3NameCreation affects the time when a directory
is created (in that case: when a profile is created), not when it is used. That
is whether mkdir generates two names or just one.
- Setting TEMP to C:\Temp is a valid workaround for the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

Eugene Petrenko <eu...@jetbrains.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #7 from Eugene Petrenko <eu...@jetbrains.com> ---
Please remember the possible issue with Windows XP:
http://social.technet.microsoft.com/Forums/zh/itproxpsp/thread/a4f428ba-1826-46a0-999a-972ae4279fbe

For some reason/bug path to %TEMP% may be not 8.3 style formatted. This simply
makes catallina.bat fail and not start Tomcat. 

I faced exactly the same issue on my test Windows XP VM.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #8 from Mark Thomas <ma...@apache.org> ---
There is no way I am aware of to fix this. See comment #3. Please do not
re-open this issue unless you have a patch that actually fixes the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
Neat trick. While that fixes the first problem, a similar approach can't be
used for the following lines that use IF and %TEMP%.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WONTFIX                     |FIXED

--- Comment #10 from Konstantin Kolinko <kn...@gmail.com> ---
Fixed in trunk and 7.0 by r1344725 and r1344732 and will be in 7.0.28.

Note that
- The issue only affects the "run" command. All other command skip that code.
- The issue affects 7.0.x only. Earlier versions do not have that code in
catalina.bat.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work if TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|catalina.bat run does not   |catalina.bat run does not
                   |work is TEMP contains       |work if TEMP contains
                   |spaces                      |spaces

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


DO NOT REPLY [Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> 2012-04-20 18:50:40 UTC ---
It is funny. I have WinXP. The "TEMP" variable is configured as

%USERPROFILE%\Local Settings\Temp

by default for the current user in the setting dialog (Win+Pause), but cmd
shows

> echo %TEMP%
C:\DOCUME~1\username\LOCALS~1\Temp

So the current catalina.bat already works for majority of Windows XP users,
including me.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Given that %TEMP% may or may not contain spaces ad may or may not be quoted I
simply do not see a way of getting this to work for all possible input. I'd be
happy to be proved wrong though.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work is TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

--- Comment #6 from Christopher Schultz <ch...@christopherschultz.net> ---
We could detect the spaces in %TEMP% and issue an error message, stopping the
startup script rather than ending up giving the user a bizarre error and
letting them try to figure it out.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work if TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

--- Comment #11 from Sebb <se...@apache.org> ---
(In reply to comment #9)
> (In reply to comment #3)

...

> You naturally do not use quotes when you configure values through GUI.
> The syntax for SET command is less intuitive. For reference:
> 
> SET "TEMP=value"
>

On WinXP, the command:
SET TEMP1=a b c
is the same as
SET "TEMP2=a b c"

Neither adds quotes to the value of X.
However, the following command does add quotes:

SET TEMP3="a b c"

The result of the above is:

TEMP1=a b c
TEMP2=a b c
TEMP3="a b c"

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 53115] catalina.bat run does not work if TEMP contains spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

--- Comment #12 from Sebb <se...@apache.org> ---
AFAICT, the TEMP directory is being used for two purposes:

1) for a file containing "Y"
2) as a marker to stop a recursive call of catalina.bat

The first use is trivial to eliminate; just ship Tomcat with a suitable file

The second use can also be eliminated.

If you can assume that Command Extensions are enabled, the following will work:

rem Suppress Terminate batch job on CTRL+C
if not ""%1"" == ""run"" goto mainEntry
if ""%TEMP%"" == """" goto mainEntry
rem Assumes Y.DAT exists
call :mainEntry %* <Y.DAT
rem Use provided errorlevel
set RETVAL=%ERRORLEVEL%
exit /B %RETVAL%
:mainEntry

If not, then rather than using a marker file in TEMP, you can use a SET
variable:

rem Suppress Terminate batch job on CTRL+C
if not ""%1"" == ""run"" goto mainEntry
if ""%TEMP%"" == """" goto mainEntry
if ""%_RECURSE_%"" == ""TrUe"" goto mainEntry
set _RECURSE_=TrUe
call "%~f0" %* <Y.DAT
rem Use provided errorlevel
set RETVAL=%ERRORLEVEL%
set _RECURSE_=
exit /B %RETVAL%
:mainEntry

Yet another possibility is to split catalina.bat into two so the mainEntry code
is in a separate file. This solves the recursive call issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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