Discussion:
reinstall TC service after java upgrade?
Berneburg, Cris J. - US
2018-11-02 19:50:57 UTC
Permalink
Hi Folks

I upgraded Java from 8u181 to 8u191 on our dev (JDK) and test (JRE) Windows 2012 servers today. After doing so, the Tomcat 8.5(.32) Windows services would no longer start. Removing and re-adding the service fixed the service. I don't remember having to re-install the TC Windows services after upgrading Java previously. Is that normal?

1. Stop TC Windows Service.
2. Uninstall old Java.
3. Install new Java.
4. Update Windows environment var - JAVA_HOME for dev, JRE_HOME for test.
5. Try to start TC Win Service - Fail. Helpful error code of "1". Windows Event Log says "incorrect function".
6. Run startup.bat manually from a command prompt - worked.
7. Run shutdown.bat to stop the manual startup.
8. Close Windows Services panel.
9. Delete TC Win Service with "Service.bat remove".
10. Recreate TC Win Service with "Service.bat install".
11. Open Windows Services panel.
12. Modify TC Win service to automatic start.
13. Start TC Win Service - OK.

Please note that I did not reboot the servers between steps.

Does the TC executable write Java-specific info to the Windows registry (or something) that locks the service to a specific Java location or version? I don't see any registry commands in the service batch file.

--
Cris Berneburg
CACI Lead Software Engineer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Mark Thomas
2018-11-02 20:09:02 UTC
Permalink
Post by Berneburg, Cris J. - US
Hi Folks
I upgraded Java from 8u181 to 8u191 on our dev (JDK) and test (JRE) Windows 2012 servers today. After doing so, the Tomcat 8.5(.32) Windows services would no longer start. Removing and re-adding the service fixed the service. I don't remember having to re-install the TC Windows services after upgrading Java previously. Is that normal?
It is one way to fix the problem. You need to reconfigure where the
service looks for the JRE. Normally you'd do that with Tomcat[7|8|9]w.exe

Mark
Post by Berneburg, Cris J. - US
1. Stop TC Windows Service.
2. Uninstall old Java.
3. Install new Java.
4. Update Windows environment var - JAVA_HOME for dev, JRE_HOME for test.
5. Try to start TC Win Service - Fail. Helpful error code of "1". Windows Event Log says "incorrect function".
6. Run startup.bat manually from a command prompt - worked.
7. Run shutdown.bat to stop the manual startup.
8. Close Windows Services panel.
9. Delete TC Win Service with "Service.bat remove".
10. Recreate TC Win Service with "Service.bat install".
11. Open Windows Services panel.
12. Modify TC Win service to automatic start.
13. Start TC Win Service - OK.
Please note that I did not reboot the servers between steps.
Does the TC executable write Java-specific info to the Windows registry (or something) that locks the service to a specific Java location or version? I don't see any registry commands in the service batch file.
--
Cris Berneburg
CACI Lead Software Engineer
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Berneburg, Cris J. - US
2018-11-07 12:33:16 UTC
Permalink
Thanks Mark

cjb> I upgraded Java from 8u181 to 8u191 on our dev (JDK) and test (JRE)
cjb> Windows 2012 servers today. After doing so, the Tomcat 8.5(.32)
cjb> Windows services would no longer start. Removing and re-adding
cjb> the service fixed the service. I don't remember having to re-install
cjb> the TC Windows services after upgrading Java previously. Is that normal?

mt> It is one way to fix the problem. You need to reconfigure where the
mt> service looks for the JRE. Normally you'd do that with Tomcat[7|8|9]w.exe

Wow, I actually did not know that. I feel a bit embarrassed not knowing something that basic. Did you notice my ApacheCon badge? "Tomcat Newbie". :-)

Then again, why doesn't the service just use the JAVA_HOME or JRE_HOME environment vars? Is that so there can be multiple services running with different versions of Java simultaneously?
--
Cris Berneburg
CACI Lead Software Engineer

B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[�\�\��][��X��ܚX�P�X�] �\X�K�ܙ�B��܈Y][ۘ[��[X[��K[
André Warnier (tomcat)
2018-11-07 13:00:35 UTC
Permalink
Post by Berneburg, Cris J. - US
Thanks Mark
cjb> I upgraded Java from 8u181 to 8u191 on our dev (JDK) and test (JRE)
cjb> Windows 2012 servers today. After doing so, the Tomcat 8.5(.32)
cjb> Windows services would no longer start. Removing and re-adding
cjb> the service fixed the service. I don't remember having to re-install
cjb> the TC Windows services after upgrading Java previously. Is that normal?
mt> It is one way to fix the problem. You need to reconfigure where the
mt> service looks for the JRE. Normally you'd do that with Tomcat[7|8|9]w.exe
Wow, I actually did not know that. I feel a bit embarrassed not knowing something that basic. Did you notice my ApacheCon badge? "Tomcat Newbie". :-)
Then again, why doesn't the service just use the JAVA_HOME or JRE_HOME environment vars? Is that so there can be multiple services running with different versions of Java simultaneously?
Basically yes. Each service also picks up many other arguments there.
For a complete explanation, I recommend :
https://wiki.apache.org/tomcat/FAQ/Windows#Q11
(disclaimer : I get bonus points each time someone reads that)
Post by Berneburg, Cris J. - US
--
Cris Berneburg
CACI Lead Software Engineer
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Berneburg, Cris J. - US
2018-11-09 18:59:41 UTC
Permalink
Thanks André

cjb> I upgraded Java from 8u181 to 8u191 on our dev (JDK) and test
cjb> (JRE) Windows 2012 servers today. After doing so, the Tomcat
cjb> 8.5(.32) Windows services would no longer start. Removing and
cjb> re-adding the service fixed the service.

mt> You need to reconfigure where the service looks for the JRE.
mt> Normally you'd do that with Tomcat[7|8|9]w.exe

cjb> why doesn't the service just use the JAVA_HOME or JRE_HOME
cjb> environment vars? Is that so there can be multiple services
cjb> running with different versions of Java simultaneously?

aw> Basically yes. Each service also picks up many other arguments there.
aw> For a complete explanation, I recommend :
aw> https://wiki.apache.org/tomcat/FAQ/Windows#Q11
aw> (disclaimer : I get bonus points each time someone reads that)

I read it, possibly again. André ++;

Can we put a note in there saying that if a different version of Java is installed and the old one is removed, the registry entries are no longer valid and need to be refreshed by running Tomcat[#]w.exe to reference the new Java?

<Begin Draft Text>
Note that the JVM location is also stored in the Windows Registry by Tomcat[#]w.exe (prunmgr) and is referenced by the service wrapper (prunsrv). This means that if the Java location changes, such as removing an older JVM and installing a newer version, the Registry entries will no longer be valid, and the Tomcat service will no longer run. Running Tomcat[#]w.exe and updating the JVM location on the Java tab or selecting the "Use default" checkbox can remedy that.
<End Draft Text>
"One more thing [...]"

Wait a minute. Could it simply be that the "Use default" checkbox (for JVM) on the Java tab was unchecked for me? Argh. Cris --;
--
Cris Berneburg
CACI Lead Software Engineer

B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[�\�\��][��X��ܚX�P�X�] �\X�K�ܙ�B��܈Y][ۘ[��[X[��K[
Loading...