tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Cannot start apache tomcat 7.0 if server path contains two consecutive spaces.
Date Wed, 31 Jul 2013 17:27:17 GMT
TRAN Trung Thanh wrote:
> Hi all,
> I am newbie here.
> Today, I tried to start apache tomcat 7.0.42 in Linux environment. 
> Server path contains two consecutive spaces. When I run ./ 
> run, server cannot start and there is the following exception in console
> ./ run
> Using CATALINA_BASE:   /home/example/twoconsecutive  spaces
> Using CATALINA_HOME:   /home/example/twoconsecutive  spaces
> Using CATALINA_TMPDIR: /home/example/twoconsecutive  spaces/temp
> Using JRE_HOME:        /home/example/java/jdk1.6
> Using CLASSPATH:       /home/example/twoconsecutive 
> spaces/bin/bootstrap.jar:/home/example/twoconsecutive 
> spaces/bin/tomcat-juli.jar
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/catalina/startup/Bootstrap
> Caused by: java.lang.ClassNotFoundException: 
> org.apache.catalina.startup.Bootstrap
>     at$
>     at Method)
>     at
>     at java.lang.ClassLoader.loadClass(
>     at sun.misc.Launcher$AppClassLoader.loadClass(
>     at java.lang.ClassLoader.loadClass(
> Could not find the main class: org.apache.catalina.startup.Bootstrap.  
> Program will exit.
> Tomcat server can start if  server path does not contain consecutive space.
> Do anyone face to the same issue with me in this case? Have you any 
> suggestion to fix this issue?

Yes : don't do that (using spaces in paths).

   It is quite important for my deployment.

That's a pity.
Spaces in paths (and filenames) are evil, and should never have been allowed in the first

place.  A special place in hell is reserved for the genius who first allowed this stupid 
thing in an OS.  I wish I had 0.1 cent for every programming hour lost because of this.

Technically, you can certainly find the correct way to quote them in any particular place

and environment.  But usually, this is merely moving the problem to some other place 
further down the line, where it is even less visible and harder to find the bugs.
I suppose the same could be said about any non-visible character, but spaces (along with 
TAB) are specially evil because in most environments, they are considered either as valid

separators between words/tokens or as "non-significant".

My serious recommendation would be to think really hard about a way to nip this in the 
bud, and avoid allowing them and using them in the first place.
Think that if you allow them somewhere, and even if you quote them correctly there, you 
will have to continue quoting them (appropriately) everywhere else that you are using the

corresponding strings.  It is almost guaranteed that this will bite you somewhere.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message