Hi, This looks solved. I noticed that when I use service.bat install it adds the following java options:
-Dcatalina.base=C:\tomcat -Dcatalina.home=C:\tomcat -Djava.endorsed.dirs=C:\tomcat\common\endorsed -Djava.io.tmpdir=C:\tomcat\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\tomcat\conf\logging.properties When I add them to my command line install, the service can be started and stopped from the command line as well as from the windows services panel. (The service does needs to be started after it is installed - it doesn't start by itself, but that's perfectly fine.) I futher found that I could specify -Dserver in the JvmOptions and use --Jvm="C:\Program Files\Java\jdk1.5.0_12\jre\bin\server\jvm.dll" and it still installs, starts, and stops as I hoped and prayed it would. I learned quite a bit from this exchange, so I'll proceed from here. Thanks for all the help, Eric -----Original Message----- From: Eric Hawkes Sent: Wednesday, March 12, 2008 5:30 PM To: 'Tomcat Users List' Cc: Eric Hawkes Subject: RE: Can't start tomcat 5.5.26 service on windows Hi, I tried the things you suggested, and they helped, but I'm afraid I'm still having problems. Tomcat does install as a service, but cannot be started. stderr.log shows a java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina Further explanation below. I found a couple of other odd things, also explained below. I installed the service from a DOS cmd window, like this: C:\tomcat\bin\tomcat5.exe //IS//Tomcat5 \ --DisplayName="Apache Tomcat 5.5" --Install=C:\tomcat\bin\tomcat5.exe \ --Jvm=auto --Startup=auto --StartMode=jvm --StopMode=jvm \ --StartClass=org.apache.catalina.startup.Bootstrap --StartParams=start \ --StopClass=org.apache.catalina.startup.Bootstrap --StopParams=stop \ --LogPath=C:\tomcat\logs --LogLevel=Debug \ --StdOutput=C:\tomcat\logs\stdout.log --StdError=C:\tomcat\logs\stderr.log \ --Classpath=C:\tomcat\bin\bootstrap.jar Running tomcat5w verifies that the parameters have been set as I intended. One note: the Java tab has the "Use default" check box checked, and the JVM path says: C:\Program Files\Java\jre1.5.0_12\bin\client\jvm.dll I kind of expected that tomcat5 would use the JDK preferentially. Attempting to start the service from the windows services panel causes this error dialog: The Apache Tomcat 5.5 service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service. The jakarta_service log says: [2008-03-12 16:21:47] [1334 prunsrv.c] [debug] Procrun log initialized [2008-03-12 16:21:47] [info] Procrun (2.0.3.0) started [2008-03-12 16:21:47] [532 prunsrv.c] [debug] Installing service... [2008-03-12 16:21:47] [info] Service Tomcat5 name Apache Tomcat 5.5 [2008-03-12 16:21:47] [info] Service Tomcat5 installed [2008-03-12 16:21:47] [info] Procrun finished. [2008-03-12 16:22:08] [1334 prunsrv.c] [debug] Procrun log initialized [2008-03-12 16:22:08] [info] Procrun (2.0.3.0) started [2008-03-12 16:22:08] [info] Running Service... [2008-03-12 16:22:08] [1158 prunsrv.c] [debug] Inside ServiceMain... [2008-03-12 16:22:08] [info] Starting service... [2008-03-12 16:22:08] [385 javajni.c] [debug] Jvm Option[0] -Djava.class.path=C:\tomcat\bin\bootstrap.jar [2008-03-12 16:22:08] [385 javajni.c] [debug] Jvm Option[1] vfprintf [2008-03-12 16:22:08] [471 javajni.c] [debug] argv[0] = start [2008-03-12 16:22:08] [508 javajni.c] [debug] Java Worker thread finished [2008-03-12 16:22:09] [1007 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2008-03-12 16:22:09] [info] Service started in 1140 ms. [2008-03-12 16:22:09] [1250 prunsrv.c] [debug] Waiting worker to finish... [2008-03-12 16:22:09] [1255 prunsrv.c] [debug] Worker finished. [2008-03-12 16:22:09] [info] Run service finished. [2008-03-12 16:22:09] [info] Procrun finished. The stderr log says: java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:222) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410) I used WinRAR to look inside bootstrap.jar, and in fact, there is no org.apache.catalina.startup.Catalina class. These files are present in org.apache.catalina.startup Bootstrap.class catalina.properties CatalinaProperties.class ClassLoaderFactory.class Tool.class I did some web searching on the exception, but did not find anything very helpful. > I would recommend installing Tomcat (and the JVM) in directory paths > without spaces; Okay: I have installed tomcat (via unzipping it) into c:\tomcat I also copied msvcr71.dll from C:\WINDOWS\system32 to c:\tomcat\bin CATALINA_HOME=C:\tomcat > The CLASSPATH environment variable is an abomination Okay: I have removed it completely. > You should set JAVA_HOME only for a JDK. Thanks. I now have the JDK installed, and I changed JAVA_HOME JAVA_HOME=C:\Program Files\Java\jdk1.5.0_12 > Can you launch the server mode with "java -server -version"? I found a surprise: C:\tomcat>java -server -version Error: no `server' JVM at `C:\Program Files\Java\jre1.5.0_12\bin\server\jvm.dll'. That's true, but I was expecting java -version to look for the JDK, not the JRE because I installed the JDK and I have JAVA_HOME=C:\Program Files\Java\jdk1.5.0_12 C:\tomcat>which java C:\WINDOWS\system32/java.exe C:\tomcat>C:\WINDOWS\system32\java -version java version "1.5.0_12" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04) Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing) Another surprise. I didn't know java was copied to the C:\WINDOWS\system32 directory. This is early in my PATH, so I guess it isn't too strange. Using the following parameters in my install command: --Jvm="C:\Program Files\Java\jdk1.5.0_12\jre\bin\server\jvm.dll" --JvmOptions=-server gave me a slightly different error: [2008-03-12 16:13:14] [1334 prunsrv.c] [debug] Procrun log initialized [2008-03-12 16:13:14] [info] Procrun (2.0.3.0) started [2008-03-12 16:13:14] [532 prunsrv.c] [debug] Installing service... [2008-03-12 16:13:14] [info] Service Tomcat5 name Apache Tomcat 5.5 [2008-03-12 16:13:14] [info] Service Tomcat5 installed [2008-03-12 16:13:14] [info] Procrun finished. [2008-03-12 16:13:21] [1334 prunsrv.c] [debug] Procrun log initialized [2008-03-12 16:13:21] [info] Procrun (2.0.3.0) started [2008-03-12 16:13:21] [info] Running Service... [2008-03-12 16:13:21] [1158 prunsrv.c] [debug] Inside ServiceMain... [2008-03-12 16:13:21] [info] Starting service... [2008-03-12 16:13:21] [385 javajni.c] [debug] Jvm Option[0] -server [2008-03-12 16:13:21] [385 javajni.c] [debug] Jvm Option[1] -Djava.class.path=C:\tomcat\bin\bootstrap.jar [2008-03-12 16:13:21] [385 javajni.c] [debug] Jvm Option[2] vfprintf [2008-03-12 16:13:21] [395 javajni.c] [error] CreateJavaVM Failed [2008-03-12 16:13:21] [992 prunsrv.c] [error] Failed initializing java C:\tomcat\bin\bootstrap.jar [2008-03-12 16:13:21] [1260 prunsrv.c] [error] ServiceStart returned 2 [2008-03-12 16:13:21] [info] Run service finished. [2008-03-12 16:13:21] [info] Procrun finished. Environment ----------- I'm running on Windows XP SP2, x86 hardware. I have the correct version of Java for my hardware and OS. I got JDK 1.5.0_12 from Sun's download site, and tomcat 5.5.26 from Apache's download site. C:\tomcat>set ALLUSERSPROFILE=C:\Documents and Settings\All Users ANT_HOME=c:\ant APPDATA=C:\Documents and Settings\echawkes\Application Data CATALINA_HOME=C:\tomcat CLIENTNAME=Console CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=EHAWKES-9439 ComSpec=C:\WINDOWS\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: HOMEPATH=\Documents and Settings\echawkes HOMESHARE=\\whistler\users INCLUDE=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include\ JAVA_HOME=C:\Program Files\Java\jdk1.5.0_12 LIB=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\ LOGONSERVER=\\SVL0DC04 MMCommonAppDataRoot=C:\Documents and Settings\All Users\Application Data\Avaya M odular Messaging MM_MSXML_APARTMENT=1 NUMBER_OF_PROCESSORS=2 OS=Windows_NT Path=C:\Program Files\Avaya Modular Messaging\Common;C:\Program Files\Avaya Modu lar Messaging\Common;C:\Program Files\Common Files\Avaya Modular Messaging;C:\Pe rl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\bin;c :\ant;c: \ant\bin;C:\Program Files\Perforce;C:\Program Files\SonicWallES;"C:\Program File s\MailFrontier";C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Micr osoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=0403 ProgramFiles=C:\Program Files PROMPT=$P$G QTJAVA=C:\Program Files\Java\jre1.5.0_12\lib\ext\QTJava.zip SESSIONNAME=RDP-Tcp#2 SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\echawkes\LOCALS~1\Temp TMP=C:\DOCUME~1\echawkes\LOCALS~1\Temp UMCommon=C:\Program Files\Avaya Modular Messaging\Common USERDNSDOMAIN=SV.US.SONICWALL.COM USERDOMAIN=SV USERNAME=echawkes USERPROFILE=C:\Documents and Settings\echawkes VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\ VSCOMNTOOLS="C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\" windir=C:\WINDOWS Thanks, Eric -----Original Message----- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2008 7:10 AM To: Tomcat Users List Subject: RE: Can't start tomcat 5.5.26 service on windows > From: Eric Hawkes [mailto:[EMAIL PROTECTED] > Subject: RE: Can't start tomcat 5.5.26 service on windows > > We install the JRE, and then we copy the server jvm.dll > (taken from an SDK install) to > C:\Program Files\Java\jre1.5.0_12\bin\server\jvm.dll Does the server jvm.dll you're copying come from the exact same build and platform (32- vs 64-bit) as the JRE? You would think that would be sufficient, but if you do a detailed comparison of the files in a public JRE against those in a JDK's private JRE you'll see lots of differences, including the contents of various *.jar files. (For example, rt.jar from the JDK is 4 MB larger than the one in the JRE.) I don't know why the two sets of jars should be different, but they are, and it may be pertinent. Can you launch the server mode with "java -server -version"? (Note that the -server option here applies only to the launcher, it's not done that way when running as a service.) What happens when you set JAVA_OPTS=-server and start Tomcat with startup.bat? > We simply point tomcat to the server jvm.dll. Verify it's done properly by changing it in the GUI and see the effect it has on the registry settings for Tomcat. > My JAVA_HOME is C:\Program Files\Java\jre1.5.0_12 You should set JAVA_HOME only for a JDK. The non-service scripts expect JRE_HOME for a JRE-only setup, but the service.bat script ignores that (possibly because a Windows JRE doesn't include the server mode or more likely because someone forgot to update this script when the JRE_HOME check was added to the other scripts). - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]