You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "will@serensoft.com" <wi...@serensoft.com> on 2009/05/17 02:05:36 UTC

startup.bat and catalina.bat -> NoClassDefFoundError: server

First, I appreciate your responses and your help. Thanks! Here's my
new question:


Short version:
We find what the launch-tomcat command is from the startup.bat and
catalina.bat files, and paste that in directly at the command line,
only to get:
"Exception in thread "main" java.lang.NoClassDefFoundError: server"

It it naive to think this is our problem? (E.g. the batch file may be
setting other variables...) Ideas?


Long version:

Okay, so we're trying to get Tomcat to run under 64-bit Windows 2003
Enterprise... Java is fine, but tomcat won't even begin to start.
Blip, the console window shows up and instantly goes away again, no
files open, no ports open, no tomcat/java process at all.

When we "rem" the "@echo off" statements in the Tomcat batch files to
see what's going on, we can see that the final command to execute
tomcat is:

start "Tomcat" "C:\Java\jdk1.5.0_18\bin\java" server -Xms768m -Xmx768m
-XX:PermSize=128m -XX:MaxPermSize=256m -XX:NewSize=192m
-XX:MaxNewSize=384m -XX:+UseParallelGC
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="C:\Tomcat55\conf\logging.properties"
 -Djava.endorsed.dirs="C:\Tomcat55\common\endorsed" -classpath
"C:\Java\jdk1.5.0_18\lib\tools.jar;C:\Tomcat55\bin\bootstrap.jar"
-Dcatalina.base="C:\Tomcat55" -Dcatalina.home="C:\Tomcat55"
-Djava.io.tmpdir="C:\Tomcat55\temp"
org.apache.catalina.startup.Bootstrap  start

Meaning that we're just basically calling java, with the tomcat
bootstrap.jar of course. So we try pasting that command (without the
'start "[arg]"') and we get:
Exception in thread "main" java.lang.NoClassDefFoundError: server

Is this error misleading? Bootstrap.jar is indeed where it's expected...

Is there something else in the batch file that would set up a more
reasonable environment so that the 'server' class would be found? If
not, is there something obvious here that we've missed in order to get
tomcat off the ground?


C:\Tomcat55>java -version
java version "1.5.0_18"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_18-b02, mixed mode)

Java runs hello-world just fine.


Ancillary question:

tomcat connector, tomcat native, and 64-bit windows

tomcat.apache.org offers a ZIP download of tomcat, plus a "tomcat
connector" and a "tomcat native". There's documentation for each, but
the intended audience seems to be folks who already know what each of
those is for.

What would the "tomcat connector" be for, or what's the "native"
instance all about. At tomcat.apache.org there are 64-bit downloads in
those categories, but how do they relate to the normal ZIP downloads?





-- 
will trillich
"Our only real economic security lies in our power to meet human
needs." -- S.Covey, the 8th Habit

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


Re: startup.bat and catalina.bat -> NoClassDefFoundError: server

Posted by will trillich <tr...@gmail.com>.
On Sun, May 17, 2009 at 6:33 AM, André Warnier <aw...@ice-sa.com> wrote:
> You are missing a "-" before the "server", so java thinks this is the
> argument (the name of the class to run), not a switch as it should be.

Yes indeedy, that was exactly the problem. Reminds me of looking for a
problem in my C code, back in college -- took days to notice that
there was one missing (or extra) semicolon.

Thanks!

-- 
will trillich
"Our only real economic security lies in our power to meet human
needs." -- S.Covey, the 8th Habit

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


Re: startup.bat and catalina.bat -> NoClassDefFoundError: server

Posted by André Warnier <aw...@ice-sa.com>.
will@serensoft.com wrote:
> First, I appreciate your responses and your help. Thanks! Here's my
> new question:
> 
> 
> Short version:
> We find what the launch-tomcat command is from the startup.bat and
> catalina.bat files, and paste that in directly at the command line,
> only to get:
> "Exception in thread "main" java.lang.NoClassDefFoundError: server"
> 
> It it naive to think this is our problem? (E.g. the batch file may be
> setting other variables...) Ideas?
> 
> 
> Long version:
> 
> Okay, so we're trying to get Tomcat to run under 64-bit Windows 2003
> Enterprise... Java is fine, but tomcat won't even begin to start.
> Blip, the console window shows up and instantly goes away again, no
> files open, no ports open, no tomcat/java process at all.
> 
> When we "rem" the "@echo off" statements in the Tomcat batch files to
> see what's going on, we can see that the final command to execute
> tomcat is:
> 
> start "Tomcat" "C:\Java\jdk1.5.0_18\bin\java" server -Xms768m -Xmx768m
> -XX:PermSize=128m -XX:MaxPermSize=256m -XX:NewSize=192m
> -XX:MaxNewSize=384m -XX:+UseParallelGC
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file="C:\Tomcat55\conf\logging.properties"
>  -Djava.endorsed.dirs="C:\Tomcat55\common\endorsed" -classpath
> "C:\Java\jdk1.5.0_18\lib\tools.jar;C:\Tomcat55\bin\bootstrap.jar"
> -Dcatalina.base="C:\Tomcat55" -Dcatalina.home="C:\Tomcat55"
> -Djava.io.tmpdir="C:\Tomcat55\temp"
> org.apache.catalina.startup.Bootstrap  start
> 
> Meaning that we're just basically calling java, with the tomcat
> bootstrap.jar of course. So we try pasting that command (without the
> 'start "[arg]"') and we get:
> Exception in thread "main" java.lang.NoClassDefFoundError: server
> 
> Is this error misleading? Bootstrap.jar is indeed where it's expected...
> 
The error is not misleading, it is spot on.
You are missing a "-" before the "server", so java thinks this is the 
argument (the name of the class to run), not a switch as it should be.



> Is there something else in the batch file that would set up a more
> reasonable environment so that the 'server' class would be found? If
> not, is there something obvious here that we've missed in order to get
> tomcat off the ground?
> 
> 
> C:\Tomcat55>java -version
> java version "1.5.0_18"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
> Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_18-b02, mixed mode)
> 
> Java runs hello-world just fine.
> 
> 
> Ancillary question:
> 
> tomcat connector, tomcat native, and 64-bit windows
> 
> tomcat.apache.org offers a ZIP download of tomcat, plus a "tomcat
> connector" and a "tomcat native". There's documentation for each, but
> the intended audience seems to be folks who already know what each of
> those is for.
> 
> What would the "tomcat connector" be for, or what's the "native"
> instance all about. At tomcat.apache.org there are 64-bit downloads in
> those categories, but how do they relate to the normal ZIP downloads?
> 
> 
> 
> 
> 


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


RE: startup.bat and catalina.bat -> NoClassDefFoundError: server

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: trillich@gmail.com [mailto:trillich@gmail.com] On Behalf Of
> will@serensoft.com
> Subject: startup.bat and catalina.bat -> NoClassDefFoundError: server
> 
> We find what the launch-tomcat command is from the startup.bat and
> catalina.bat files, and paste that in directly at the command line,
> only to get:
> "Exception in thread "main" java.lang.NoClassDefFoundError: server"

Looks like you have set JAVA_OPTS or CATALINA_OPTS to "server" - which is incorrect.  When used, it should be "-server"; however, since you're on a 64-bit JVM, it's always in server mode, and the option is not needed.

> start "Tomcat" "C:\Java\jdk1.5.0_18\bin\java" server -Xms768m -Xmx768m

As stated before, you're missing the dash in front of "server" (but you don't need -server at all).

> What would the "tomcat connector" be for, or what's the "native"
> instance all about. At tomcat.apache.org there are 64-bit downloads in
> those categories, but how do they relate to the normal ZIP downloads?

The Tomcat Connectors are for front-ending Tomcat with httpd or IIS; if you're running Tomcat standalone (which your are), you don't need them.

The Tomcat Native is a subset of httpd known as the Apache Portable Runtime.  It replaces the Java HTTP/HTTPS handler in Tomcat with one written in C; this will provide better SSL performance and may improve non-SSL performance in some situations.

These extra pieces have 64-bit versions since they are written in C, and must therefore must match the mode the JVM process is running in - just as the tomcat5.exe and tomcat5w.exe executables must.  Tomcat itself is pure Java, so is platform and architecture independent.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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