You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Fabien Nisol <ni...@hydro.qc.ca> on 2002/03/22 19:57:44 UTC

bug in catalina.sh

Hello,

I noticed a bug in catalina.sh that make some of us have problem starting 
tomcat. The common error is that a message

usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ 
-debug ] [ -nonaming ] { start | stop }

is printed in $CATALINA_HOME/logs/catalina.out

I began to look at this problem and I finally found the bug:

The problem is that at every line where catalina is started ("$_RUNJAVA 
..."), command line arguments that are passed to the catalina.sh script are 
passed using "$_RUNJAVA" <javaargs> <catalinaClass> "$@" <command> (quotes 
included) ... The problem : When only one argument is passed to the VM , in 
Catalina.main(String args[]), args are { "" , <command> } and not { 
<command> } ... ( starting catalina.sh start means starting "java 
<javaargs> <class> "" start", not "java <javaargs> <class> start") ...

big problem in Catalina.arguments(String[] args) where the argument "" 
(empty string) is not recognised and issues an error on stdout...

I think the problem could be corrected by replacing all "$@" (with quotes) 
occurence by $@ (without quotes) in catalina.sh

Are you ok with this or am I missing something??


Fabien Nisol
java Developer/Analyst consultant




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: bug in catalina.sh

Posted by Patrick Luby <pa...@sun.com>.
Fabien,

Since the "$@" is necessary to preserve quoting of arguments with spaces in
them, changing it to $@ is not a really good solution. First off, which Unix
platform are you using? I know that the "$@" works on Solaris and Linux and Mac
OS X.

Also, have you tried using "${@}"? Most platfroms don't require the curly braces
to preserve quoting, but maybe yours does.

Patrick

Fabien Nisol wrote:
> 
> Hello,
> 
> I noticed a bug in catalina.sh that make some of us have problem starting
> tomcat. The common error is that a message
> 
> usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [
> -debug ] [ -nonaming ] { start | stop }
> 
> is printed in $CATALINA_HOME/logs/catalina.out
> 
> I began to look at this problem and I finally found the bug:
> 
> The problem is that at every line where catalina is started ("$_RUNJAVA
> ..."), command line arguments that are passed to the catalina.sh script are
> passed using "$_RUNJAVA" <javaargs> <catalinaClass> "$@" <command> (quotes
> included) ... The problem : When only one argument is passed to the VM , in
> Catalina.main(String args[]), args are { "" , <command> } and not {
> <command> } ... ( starting catalina.sh start means starting "java
> <javaargs> <class> "" start", not "java <javaargs> <class> start") ...
> 
> big problem in Catalina.arguments(String[] args) where the argument ""
> (empty string) is not recognised and issues an error on stdout...
> 
> I think the problem could be corrected by replacing all "$@" (with quotes)
> occurence by $@ (without quotes) in catalina.sh
> 
> Are you ok with this or am I missing something??
> 
> Fabien Nisol
> java Developer/Analyst consultant
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 
_____________________________________________________________________
Patrick Luby                          Email: patrick.luby@sun.com
Sun Microsystems                              Phone: 408-276-7471
901 San Antonio Road, USCA14-303
Palo Alto, CA 94303-4900
_____________________________________________________________________

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: bug in catalina.sh

Posted by Fabien Nisol <ni...@hydro.qc.ca>.
Thank you !
I already solved my problem by changing #!/bin/sh by #!/bin/ksh on the top 
line of each tomcat scripts.... It appears to be a Tru64 bug which was 
discussed in bugzilla on jakarta.apache.org... (I saw this after having 
posted my problem)

Thank you for your explanation for the "$@" instead of $@, I did'nt think 
of that possible problem... To bad Tru64 is not that standard ( I miss my 
Solaris station ;)



>Fabien,
>
>I posted the following message to the tomcat-dev@jakarta.apache.org mailing
>list. I am resending it to you in case you did not see it.
>
>If the "${@}" works on your OS, let me know.
>
>Patrick
>
>Fabien,
>
>Since the "$@" is necessary to preserve quoting of arguments with spaces in
>them, changing it to $@ is not a really good solution. First off, which Unix
>platform are you using? I know that the "$@" works on Solaris and Linux 
>and Mac
>OS X.
>
>Also, have you tried using "${@}"? Most platfroms don't require the curly 
>braces
>to preserve quoting, but maybe yours does.
>
>Patrick
>
>Fabien Nisol wrote:
> >
> > Hello,
> >
> > I noticed a bug in catalina.sh that make some of us have problem starting
> > tomcat. The common error is that a message
> >
> > usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [
> > -debug ] [ -nonaming ] { start | stop }
> >
> > is printed in $CATALINA_HOME/logs/catalina.out
> >
> > I began to look at this problem and I finally found the bug:
> >
> > The problem is that at every line where catalina is started ("$_RUNJAVA
> > ..."), command line arguments that are passed to the catalina.sh script are
> > passed using "$_RUNJAVA" <javaargs> <catalinaClass> "$@" <command> (quotes
> > included) ... The problem : When only one argument is passed to the VM , in
> > Catalina.main(String args[]), args are { "" , <command> } and not {
> > <command> } ... ( starting catalina.sh start means starting "java
> > <javaargs> <class> "" start", not "java <javaargs> <class> start") ...
> >
> > big problem in Catalina.arguments(String[] args) where the argument ""
> > (empty string) is not recognised and issues an error on stdout...
> >
> > I think the problem could be corrected by replacing all "$@" (with quotes)
> > occurence by $@ (without quotes) in catalina.sh
> >
> > Are you ok with this or am I missing something??
> >
> > Fabien Nisol
> > java Developer/Analyst consultant
> >
> > --
> > To unsubscribe, 
> e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>--
>_____________________________________________________________________
>Patrick Luby                          Email: patrick.luby@sun.com
>Sun Microsystems                              Phone: 408-276-7471
>901 San Antonio Road, USCA14-303
>Palo Alto, CA 94303-4900
>_____________________________________________________________________


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>