You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Berneburg, Cris J. - US" <cb...@caci.com> on 2018/11/02 19:50:57 UTC

reinstall TC service after java upgrade?

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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: reinstall TC service after java upgrade?

Posted by "Berneburg, Cris J. - US" <cb...@caci.com>.
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


Re: reinstall TC service after java upgrade?

Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 07.11.2018 13:33, Berneburg, Cris J. - US wrote:
> 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)

> --
> Cris Berneburg
> CACI Lead Software Engineer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


RE: reinstall TC service after java upgrade?

Posted by "Berneburg, Cris J. - US" <cb...@caci.com>.
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


Re: reinstall TC service after java upgrade?

Posted by Mark Thomas <ma...@apache.org>.
On 02/11/2018 19:50, Berneburg, Cris J. - US wrote:
> 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


> 
> 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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