You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Max Nitribitt <ma...@yahoo.de> on 2001/03/22 17:02:03 UTC

org.apache.tomcat.startup.Tomcat usage

hi,

When trying to start tomcat (3.2.1 built from src) I
got an error message from
org.apache.tomcat.startup.Tomcat(the -help: Usage
message). So I had a look at Tomcat.java, and found
that this would always be the case, when somebody
starts Tomcat.class with no arguments. But that's
exactly what my tomcat.sh does. That is because of the
last else statement (see below). 
Don't hit me if I'm wrong, as I'm an absolute beginner
in java and tomcat. I didn't find anything in the
users archive, and as the message refers to the source
code, I thought it would be right to post it here. So
just tell me if you think this message doesn't belong
here. 

    public  boolean processArgs(String[] args) {
	for (int i = 0; i < args.length; i++) {
	    String arg = args[i];
            
	    if (arg.equals("-help") || arg.equals("help")) {
		printUsage();
		return false;
	    } else if (arg.equals("-stop")) {
		doStop=true;
	    } else if (arg.equals("-f") ||
arg.equals("-config")) {
		i++;
		if( i < args.length ) {
		    configFile = args[i];
                } else {
                    printUsage();
                    return (false);
                }
	    } else if (arg.equals("-h") ||
arg.equals("-home")) {
		i++;
		if (i < args.length) {
		    System.getProperties().put("tomcat.home",
args[i]);
                } else {
                    printUsage();
                    return (false);
                }
// This "else" is wrong I guess
            } else {
                printUsage();
                return false;
	    }
	}
	return true;
    }  

I will be back to the machine where I installed tomcat
in a few days, and I would be glad , if anyone could
tell me, if I was wrong.

Max   
  


__________________________________________________________________
Do You Yahoo!?
Gesendet von Yahoo! Mail - http://mail.yahoo.de