Installing Tomcat 6 on Vista x64
Installing a Apache Tomcat 6 on Vista x64 is not a straightforward task especially if you use 64-bit Java. This was the most painful experience I have had so far on Vista.
Below is a list of steps to help anyone who runs into these problems. I was installing Tomcat 6.0.20 to be running using JDK 1.6.0.16.
0. Prerequisites. You installed 64-bit JDK/JRE for Windows from Sun (http://java.sun.com)
1. Download apache-tomcat-6.0.20.zip from http://tomcat.apache.org/download-60.cgi. Do not use the Windows Service Installer.
2. Unzip it into your installation directory.
3. Having set JAVA_HOME system variable does not help. You should also define JRE_HOME pointing to the JRE. Otherwise you will get the following when trying to run startup.bat:
The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE
4. Make sure you can start and stop the server using startup.bat and shutdown.bat.
5. You will need to get the 64-bit version of tomcat6.exe. It is in the Subversion repository at http://svn.apache.org/viewvc/tomcat/tc6.0.x/tags/TOMCAT_6_0_20/res/procrun/. But here is another obstacle. Apache disabled the ability in the ViewVC configuration to download binary files from the repository. So you need to use another location: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/res/procrun/. Please note, that the SVN repository has both tomcat6.exe and tomcat6w.exe for each architecture (ia64 and amd64), while the location to download only has tomcat6.exe. The choice of architecture is also confusing (Intel Itanium or AMD). So what am I supposed to download if I have Intel Core i7 (Nehalem/Bloomfield)? AMD64. Also, there is a ‘FIXED’ bug with a request to make this less painful.
6. Copy tomcat6.exe in the installation directory to something like tomcat6.32.exe. Overwrite tomcat6.exe in the installation directory with the 64-bit version. If you do not do this step you will get this message in the System event log (after you successfully install the service and try to start it):
The Apache Tomcat Tomcat6 service terminated with service-specific error 0 (0x0).
7. Install the service by running the following command from the command prompt with administrative privileges (see the previous post how to do this):
service.bat install Tomcat6
You should be running it in the installation directory. Tomcat6 is the service name, spaces in the service name do not seem to be supported. Installation will fail if you have the User Access Control enabled.
8. Now you should be able to start the “Apache Tomcat Tomcat6” Windows service.
Notes:
1. Do not forget to check where you log files are stored. If the UAC is enabled, you may not even know that your logs are not stored.
2. JConsole will not detect your Tomcat instance if you are running the server as a Windows service.
3. (Not related to Vista, but still worth to mention). There is no admin application in Tomcat 6.
I hope experience with Tomcat 6.0.21 will be better.
Update (Jan 24, 2010): This problems should be over with the release of Tomcat 6.0.24.
Update (Mar 12, 2010): This problems is over with the release of Tomcat 6.0.26.
Windows 7 was released 3 days ago!!! Why are you fussing around with Vista?
There are a couple of things. The first one is this issue was more with Tomcat 6 than about Vista. The second one is I haven’t received my free upgrade to Windows 7. By the way, it was released on Oct 22.
Still having problems. Although unzipping rather than auto-install as you suggested finally gave me the option of using startup from a command line. I couldn’t get to your second source for tomcat6.exe and tomcat6w.exe – but was able to download from the first. I did everything you suggest. I can start-up using startup.bat … but the Windows service still gives me the error 0.
Which version did you install?
64-bit Windows zip
I had tried 32-bit/64-bit Windows Service Installer a few times and couldn’t get the service to start. So, I tried your approach with the 64-bit zip file.
BTW: for tomcat6 – tomcat website instructions say to use //IS// for service installation rather than service.bat : like:
tomcat6 //IS//Tomcat6 –DisplayName=”Apache Tomcat 6″ –Install=”C:\Programs\Tomcat\bin\tomcat6.exe” –Jvm=auto –StartMode=jvm –StopMode=jvm –StartClass=org.apache.catalina.startup.Bootstrap –StartParams=start –StopClass=org.apache.catalina.startup.Bootstrap –StopParams=stop
You may try to copy this code to a REG file (e.g. tomcat6.reg)
—
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat6]
“Type”=dword:00000010
“Start”=dword:00000002
“ErrorControl”=dword:00000001
“ImagePath”=hex(2):4d,3a,5c,00
“DisplayName”=”Apache Tomcat Tomcat6”
“WOW64″=dword:00000001
“ObjectName”=”LocalSystem”
“Description”=”Apache Tomcat Server – http://tomcat.apache.org/”
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat6\Parameters]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat6\Enum]
“0”=”Root\\LEGACY_TOMCAT6\000″
“Count”=dword:00000001
“NextInstance”=dword:00000001
—
After then “open” it by double clicking in Windows Explorer. It should import this into your registry.
After you are done with this, open you registry in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat6
and update your ImagePath to the path to your service. E.g.:
C:\java\tomcat-6_0_20\bin\tomcat6.exe //RS//Tomcat6
But before doing all this, please double check your registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services) what it has already.
P.S.: I’m still running 6.0.20 and didn’t have a chance to update it to 6.0.26.
reg ran successfully and the ImagePath was already correct
C:\Programs\Tomcat\bin\tomcat6.exe //RS//Tomcat6
I tried both ways.
I mean 6.0.20, 6.0.24, 6.0.26…?
Just downloaded it today. Ran version; it’s 6.0.26
Built March 9, 2010 1805
with java jdk1.6.0.20
I’m still running on 1.6.0_16.
BTW: I don’t know if this history is worth repeating, but think I shouldn’t leave misleading information. I had this running by using the auto install. Then a few days ago, I tried running a server app in MSIE (I’d been on Firefox), and it told me it wanted to install something from Java 1.6…11 (I’m running …20). OK, I accepted, and the app & browser locked up. Then nothing worked. I’ve since uninstalled everything … i.e. all versions of java (20 & 11), jdk and tomcat. This is my latest attempt after reinstalling everything more than once. I’m feeling lucky now just to be able to run tomcat using startup.bat …. but would like to get the Windows service back.
Did I mention it still doesn’t work… probably should have been explicit.
If it’s fixed, I’ll gladly say so. Thanks for your effort and I’ll gladly thank you again if you have more ideas.
Sounds like a JAVA_HOME problem. I’ll see what else could cause the problem.
JDK installation: C:\Program Files (x86)\Java\jdk1.6.0_20
JAVA_HOME C:\Program Files (x86)\Java\jdk1.6.0_20
JRE_HOME C:\Program Files (x86)\Java\jdk1.6.0_20
(Previous attempt with JRE_HOME C:\Program Files (x86)\Java\jre6)
CATALINA_HOME C:\Programs\Tomcat
PATH %CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\bin;C:\Program Files (x86)\Java\jre6\bin
Running java version
Using CATALINA_BASE: “C:\Programs\Tomcat”
Using CATALINA_HOME: “C:\Programs\Tomcat”
Using CATALINA_TMPDIR: “C:\Programs\Tomcat\temp”
Using JRE_HOME: “C:\Program Files (x86)\Java\jdk1.6.0_20”
Using CLASSPATH: “C:\Programs\Tomcat\bin\bootstrap.jar”
Server version: Apache Tomcat/6.0.26
Server built: March 9 2010 1805
Server number: 6.0.26.0
OS Name: Windows Vista
OS Version: 6.0
Architecture: x86
JVM Version: 1.6.0_20-b02
JVM Vendor: Sun Microsystems Inc.
Wish I could edit – Where I said “Running java version” – should have said, Running tomcat version – but I guess that’s obvious.
Just to make sure we are on the same page. Among other things my “set” command returns:
JAVA_HOME=C:\path\jdk\1_6_0_16
JRE_HOME=C:\path\jdk\1_6_0_16\jre
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windo
ws\System32\WindowsPowerShell\v1.0\;C:\path\jdk\1_6_0_16\bin
A couple of differences:
JRE_HOME points to the JRE within JDK.
PATH points to the JDK bin directory.
JAVA_HOME C:\Program Files (x86)\Java\jdk1.6.0_20
JRE_HOME C:\Program Files (x86)\Java\jdk1.6.0_20\jre
PATH %CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files (x86)\Java\jdk1.6.0_20\bin;C:\Programs\Tomcat\bin
Still no go. Does it make a difference whether these are defined as user or system variables?
It shouldn’t matter. In my case I have the defined as user variables.
jakarta service log
[2010-05-27 19:44:42] [info] Commons Daemon procrun (1.0.2.0) started
[2010-05-27 19:44:42] [info] Service tomcat6 name Apache Tomcat tomcat6
[2010-05-27 19:44:42] [info] Service tomcat6 installed
[2010-05-27 19:44:42] [info] Commons Daemon procrun finished.
[2010-05-27 19:44:42] [info] Commons Daemon procrun (1.0.2.0) started
[2010-05-27 19:44:42] [info] Updating service…
[2010-05-27 19:44:42] [info] Service tomcat6 updated
[2010-05-27 19:44:42] [info] Update service finished.
[2010-05-27 19:44:42] [info] Commons Daemon procrun finished.
[2010-05-27 19:44:42] [info] Commons Daemon procrun (1.0.2.0) started
[2010-05-27 19:44:42] [info] Updating service…
[2010-05-27 19:44:42] [info] Service tomcat6 updated
[2010-05-27 19:44:42] [info] Update service finished.
[2010-05-27 19:44:42] [info] Commons Daemon procrun finished.
[2010-05-27 19:45:17] [info] Commons Daemon procrun (1.0.2.0) started
[2010-05-27 19:45:17] [info] Running Service…
[2010-05-27 19:45:17] [info] Starting service…
[2010-05-27 19:45:17] [206 javajni.c] [error] %1 is not a valid Win32 application.
[2010-05-27 19:45:17] [985 prunsrv.c] [error] Failed creating java C:\Program Files (x86)\Java\jdk1.6.0_20\jre\bin\server\jvm.dll
[2010-05-27 19:45:17] [1280 prunsrv.c] [error] ServiceStart returned 1
[2010-05-27 19:45:17] [info] Run service finished.
[2010-05-27 19:45:17] [info] Commons Daemon procrun finished.
JVM problem?
http://www.mkyong.com/tomcat/tomcat-error-prunsrvc-failed-creating-java-jvmdll/
Oh, OK. I missed this post before. I’ll check back tomorrow.
I’m not sure what architecture you have, but I think it’s worth to mention this.
1) I have the processor of the x64 (AMD) architecture.
2) I have JDK 1.6.0_16 (x64) installed (in Program Files).
3) I have JRE 1.6.0_15 (x86) installed (in Program Files(x86)).
4) I have java.exe, javaw.exe, javaws.exe in C:\Windows\System32 and C:\Windows\SysWOW64. Based on the PATH provided above, one of these javaw.exe will be found first when starting the Windows service. This also means that you may have your JAVA_HOME pointing to one version of JVM, but have javaw.exe from another version of JVM. I’d suggest running java -version to check what version these files are from.
I’ve been down that road more than once. Just to be sure, I repeated just as much as they explained. (I’d already copied the file and made sure it was on PATH.) I found several ‘tips’ about this problem indicating that tomcat6.exe and tomcat6w.exe have the wrong wappers (32 verses 64 bit). Suggested download replacements don’t help.
I’ll play around tonight or tomorrow and try to use this opportunity to upgrade from 6.0.20 to 6.0.26.
That was supposed to post here, under “I’ll play around tonight or …..”
These two accounts seem authoritative. As you can see, the Apache bug report is for Tomcat 5 – 2008. Certainly does throw the same errors though.
http://www-01.ibm.com/support/docview.wss?uid=swg21404257
https://issues.apache.org/bugzilla/show_bug.cgi?id=43726
I found a lot of similar postings and it seemed that copying files from one place to another, etc. worked for most people. At this point, I’m just thinking – Why me? I get the impression that this problem has since been fixed.
I did mention that it was all working before it crashed. Maybe I have a bad file somewhere in Windows (probably not java or tomcat since I’ve reinstalled all of that).
At this point, I can’t imagine what sort of stupid thing I might have done to keep it from working. But if it is my fault – well, you know – I won’t know that until I figure out what’s wrong.
When installing products that include a JRE or even JDK, the installer drops some files into the windows/system directory. These files may be quietly left behind after the product is removed if those files were held by another process. jvm.dll is one of them. I’ve seen this at least once with the Oracle Database client installer after which all Java applets stopped working. The problem was consistently reproducing. I.e. I had to reinstall Java after Oracle client installation. Another thing is the registry which tends to get messed up sometimes.
I also had problems with Tomcat 5 a while ago when it was picking up wrong JVM.
I’ve uninstalled and reinstalled the jdk (with JRE) and tomcat. If you think it still could be a problem, how can I check it?
Run java -version and see what it returns.
E.g. this is what could be returned from a 32-bit JVM:
C:\Windows\SysWOW64>java -version
java version “1.6.0_15”
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)
This is what could be returned from a 64-bit JVM:
С:\>java -version
java version “1.6.0_16”
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
I have an Intel Core 2 Duo machine.
I’ll check the other things.
Usually processor architecture is returned by running a command
set PROCESSOR_ARCHITECTURE
In my case I have ‘AMD64’ (on my 64-bit machine) and ‘x86’ (on my 32-bit machine with W2K).
AMD64
I accepted the default locations for jdk and jre installations.
The three java executables are currently in syswow64 only, with file dates showing that they’ve been created very recently. Running java -version from within the directory shows correct version.
Copying the three java executables to system32 did not change behavior.
It’s not a good idea, since syswow64 is supposed to have 32-bit libraries running withing an emulator to support compatibility. System32 on the contrary expects to have 64-bit libraries. I know this is confusing..
Since you have syswow64, you have an x64 machine. I assume you will get ‘AMD64’ as the processor architecture, but you have a 32-bit JDK/JVM. May be incompatibility arises because you use 64-bit tomcat6.exe with 32-bit JDK?
I have a 32-bit JDK/JVM????????? From what I’ve read, that would be a big problem – very possibly THE problem. I had difficulty while searching for the 64 bit versions at http://www.java.com. I went around in circles, from one page clicking on information about 64 bit versions, to a link that sent me back to the same page.
1. How do you know that my version is 32 bit?
2. Do you know where the 64 bit downloads are?
Because x64 JVM does not need to write to syswow64.
I just was about to write you, why don’t you go to: http://java.sun.com/javase/downloads/widget/jdk6.jsp and select Platform ‘Windows x64’ and download an x64 JDK..
Yes, that’s what I have.
JAVA_HOME=C:\path\jdk\1_6_0_16
JRE_HOME=C:\path\jdk\1_6_0_16\jre
I don’t know if it makes a difference, but I prefer putting things in my C:\Programs directory. It simplifies typing when I’m using a console.
The directory name should not cause any problems as long as it does not have spaces and other special characters.
SUCCESS!!!!!!!!!! YIPPEEEEEEEEE!!!!!! YAAHOOOOOO!!!!!!!!!!!!
Thank you Alex!!!!!!!!!!!!
One small thing. The Apache Tomcat icon isn’t showing up on the ‘Configure Tomcat’ entry in the Windows start menu. It still works though.
I used ‘service install tomcat6’ rather than the recommended tomcat6 //IS// for tomcat6. It’s still before 7 am here and I’m running on coffee. Maybe I’ll play with that later.
IT WORKS!!!!
Congratulations! Great, we found the root cause.
It must have been a long day/night for you…
One note. I think you still may need a 32-bit JRE if you plan to use the 32-bit Internet Explorer and need to jun Java applets. One of reason why to use the 32-bit IE as opposed to 64-bit IE is Flash may not work well in the 64-bit version.
Yes. And I checked and noticed when the java*.exe:s got installed in system32 and syswow64. I tried to load IE 64. I think that’s when the audio on my machine failed. That’s fixed now and I discovered the Flash issue in the process. It’s not ready yet.
BTW: I tried to find you on Facebook, but there were several entries for Alexander Glazkov. I picked one that looked like a techie and sent a friend request. Are you into automated logistics kinds of things?
You got the right person. Yes.
You may also find me on LinkedIn (see the about page).
Days – plural. Seriously – thanks. I googled till my eyes turned green – or some such thing.
I’ve seen some of those moving shelves at a tech. fair in Stockholm. I’ve been involved in a robotics business for a while and am expecting to open source some java code within the next several weeks that provides a general set-up for all kinds of applications (not just robots).
It would be nice to look at it.
I’ll be sure to let you know re: the grand opening. I have some work to do with testing, maybe a little refactoring, and documentation first. I will struggle a little while to write a short description on “what it does.” I always have this difficulty with software that can be used for many applications. Even our robotics software can be used to create any robot application via learning and then adapts, etc. But people keep asking: “What does your robot do?”
If you want a preview on the concept, go to http://isr.nu/ and click on the ppt presentation “Making Expert Systems and Robots Smarter: presentation in Power Point.” That’s the concept upon which the system is originally based. The three layered “Executive,” “Manager,” and “Experts” idea has been implemented using client-server approach. My prototype has two copies of the software – one sitting on top of a simple robot simulator, and one beneath a GUI “Control Center.” That provides a Control Center that can be as intelligent and complicated as you want, and the communications between the CC HLL and the Robot HLL already exist. And for example, (not yet implemented applications component) you could issue a command to the robot that it doesn’t yet know how to do, but you have the programs for the action stored on the main computer at the Control Center. The robot’s HLL sends a message back to the Control Center – I don’t know how to do that. – and the control center’s hll sends the new software.
The idea was originally conceived as an approach to building more complex expert systems, getting past the bottlenecks that were apparent in the 1980s. Considering the application in robotics came later. But even before that, it seemed to me that what I have in mind is more like an XML processor, support for an if/then or for loop, etc. It’s much more complex than any of those things – but it can be used in an extremely large number of applications. Like the XML processor, I’m not dictating what the application is, or what the content of your XML should be. I’m not telling you how many times you should loop on what variable, or the conditions of your if/then statement.
It seems to me to be generally useful higher level programming stuff; which is why I named it so generically – “High Level Logic.”
And I’m trying to decide whether to call what I’ve created, a “framework.” What it lacks is any consideration for allowing overwriting of the existing functions. The code is generally reusable rather than abstractions. Specialization of purpose is done, for example, by specialized (switchable) protocols for the client-server stuff, and generically loading specialized “experts” (any specialized software as it turns out) that perform application specific tasks when needed.
Hello Alexander,
Re: The aforementioned open-source project.
https://hll.dev.java.net/
Note: This project is on schedule to provide source code, documentation, and supportive website by the end of this month; i.e. August 31, 2010. To express interest, contact rogerfgay@dev.java.net
High Level Logic (HLL) is a framework for intelligent applications that is easy to understand and use, even by less experienced programmers. Applications consist of integrated chains of decisions and operations (see project webpage). Development of cooperating systems, each of which is built on HLL, is as easy as building a single integrated system. Application programmers build protocols that link to specialized application components. HLL “message passing” is taken to the extreme, as with independent interacting agents, while providing the backbone for complete applications around which specialized application components are applied and interact. Individual actors (intelligent agents) within the framework have specialized roles and responsibilities (and authorities) that are designed to complement one another. The HLL components form a complete working organization that controls, manages, and executes the “chains of decisions and operations” of the application.
Open public description page: http://isr.nu/hll/project/JavaNetReflect/index.htm
Project blog: http://highlevellogic.blogspot.com/
Facebook group: http://www.facebook.com/group.php?gid=117041038348962&ref=ts
Thanks for this post. This cleared up my problem completely! All I needed was the 64-bit version of Tomcat.