You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2024/01/22 15:32:20 UTC

[Bug 68518] New: Tomcat Windows Service fails when running in OpenJDK 11

https://bz.apache.org/bugzilla/show_bug.cgi?id=68518

            Bug ID: 68518
           Summary: Tomcat Windows Service fails when running in OpenJDK
                    11
           Product: Tomcat 9
           Version: 9.0.83
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: kyuubimoderocks@gmail.com
  Target Milestone: -----

Created attachment 39536
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39536&action=edit
Starting the windows service

Hi all,

I have been installing and running a Windows Service using Tomcat 9.0.83 on
OpenJDK 8 just fine. But when I moved to OpenJDK 11, specifically
microsoft-jdk-11.0.21-windows-x64.zip which I extract inside the tomcat
installation (C:\tomcat\java), the Service always fails to start
with the following error logged in commons-daemon.log:

[2024-01-19 15:39:03] [info] [15344] Apache Commons Daemon procrun
(1.3.4.0 64-bit) started.
[2024-01-19 15:39:03] [info] [15344] Running Service 'Testing'...
[2024-01-19 15:39:03] [info] [15636] Starting service...
[2024-01-19 15:39:03] [error] [18700] CreateJavaVM Failed with error [-6]
[2024-01-19 15:39:03] [error] [18700] The system cannot find the file
specified.
[2024-01-19 15:39:03] [error] [15636] Failed to start Java
[2024-01-19 15:39:03] [error] [15636] ServiceStart returned 4.
[2024-01-19 15:39:03] [info] [15344] Run service finished.
[2024-01-19 15:39:03] [info] [15344] Apache Commons Daemon procrun
finished.

I install the service as follows:

C:\tomcat\bin\tomcat9.exe //IS//Testing ^
--Description "Windows Service" ^
--DisplayName "TestingName" ^
--Install "C:\tomcat\bin\tomcat9.exe" ^
--LogPath "%CATALINA_BASE%\logs" ^
--StdOutput auto ^
--StdError auto ^
--Classpath "%CLASSPATH%" ^
--Jvm "%JVM%" ^
--StartMode jvm ^
--StopMode jvm ^
--StartPath "%CATALINA_HOME%" ^
--StopPath "%CATALINA_HOME%" ^
--StartClass org.apache.catalina.startup.Bootstrap ^
--StopClass org.apache.catalina.startup.Bootstrap ^
--StartParams start ^
--StopParams stop ^
--Startup auto ^
--JvmMs 1024 ^
--JvmMx 2048 ^
--JvmSs 2048 ^
--Environment "ksp=%KSP%" ^
--StartPath "%CATALINA_HOME%" ^
--JvmOptions9
"-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-D%CLASS_LOADER_LOG_MANAGER%;-Duser.home=%CATALINA_HOME%;-D%TRUST_STORE%;-D%TRUST_STORE_PASS%;-D%JS_LICENSE_DIR%;-D%MESSAGE_FACTORY_IMPL%;-D%SOAP_CONN_FACTORY_IMPL%;-D%SOAP_FACTORY_IMPL%;-D%TIMEZONE_AS_REGION%"
^

Where
CLASSPATH=C:\tomcat\log4j2\lib\*;C:\tomcat\log4j2\conf;C:\tomcat\bin\bootstrap.jar;C:\tomcat\bin\tomcat-juli.jar

and CATALINA_BASE=CATALINA_HOME=C:\tomcat


Only change between the upgrade from OpenJDK 8 to 11 is that JRE is not
packaged in JDK 11 anymore (C:\tomcat\java\jre doesn't exist). Therefore, I
made JRE_HOME point to JAVA_HOME (C:\tomcat\java). Also --Jvm flag was
previously pointing to C:\tomcat\java\jre\bin\server\jvm.dll, but now after the
upgrade to JDK 11, I pointed it to C:\tomcat\java\bin\server\jvm.dll since jre
folder doesn't exist.

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 68518] Tomcat Windows Service fails when running in OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68518

Christopher Schultz <ch...@christopherschultz.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |INVALID

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 68518] Tomcat Windows Service fails when running in OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68518

kyuubimoderocks@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 OS|                            |All
         Resolution|---                         |FIXED

--- Comment #2 from kyuubimoderocks@gmail.com ---
After doing more debugging and searching I discovered that -Djava.endorsed.dirs
java option was removed from JDK 11 causing the JVM not to start. Problem is
solved. thanks all.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 68518] Tomcat Windows Service fails when running in OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68518

--- Comment #1 from kyuubimoderocks@gmail.com ---
Created attachment 39537
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39537&action=edit
Logs when debug is enabled

Attached commons-daemon.log file after enabling debug mode (--LogLevel debug
flag when installing service)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org