Hi Jan,

looks like somebody/something has restarted tomcat with different
JAVA_HOME/PATH variables. It is not possible to change jvm process while
running.

Another option could be you have there running two tomcat instances.

Create cmd file e.g. tomcatStart.cmd with content like

set JAVA_HOME=c:/...
set CATALINA_HOME=c:/......
set PATH=%JAVA_HOME%/bin;%PATH%

and use only this file to start tomcat. Put there other variables eg.
JAVA_OPTS in case you have some other jvm variables.
Do not rely on MS Windows variables settings.

Regards,

Zdenek Henek


On Mon, Apr 11, 2022 at 12:18 PM Jan Tosovsky <j.tosov...@email.cz> wrote:

> We have a mixed JDK environment on our internal Windows Server.
>
> Tomcat is installed using the service installer and its service
> configuration points to the JDK 17 as it serves some internal apps
> requiring
> JDK 12+.
>
>
>
> JAVA_HOME points to older JDK 8.
>
> PATH variable contains link to JDK 8, but also to JDK 11 in this order (the
> latter link is a bug I spotted right now).
>
>
>
> And now weirdness comes. From time to time the tomcat somehow switches to
> older JDK: we detect this by the fact the internal webapp complains about
> the issue only present in pre-JDK 12 versions. I assume JDK 11 is used as
> this is related to JDK HttpClient which is not the part of the JDK 8.
>
> It is strange the only reference to JDK 11 is that PATH entry, but is the
> second one so JDK 8 should win if the PATH is somehow involved.
>
>
>
> Actual case: the tomcat was restarted manually on Friday using tray icon
> and
> in the log I can see that JDK 17 was picked up. There was no user activity
> during the weekend. Today when accessing the app error is raised. Manual
> restart via try icon fixed the issue.
>
>
>
> This issue is not urgent in any case, there are no mission-critical apps
> running on our server. But I am quite surprised by this behavior. Kind of
> the race condition, which could be dangerous.
>
>
>
> Regards, Jan
>
>
>
>

Reply via email to