Java error when trying to start Windows service

What version are you upgrading from:

System information:
Operating system: Windows Server 2019
Java version: 17
Database provider/version: SQL Server, v14

What’s the issue you’re facing:

Installed, installed version 17 of Java, can’t get the service to start.

The service installs correctly via \bin\windows-x86-64\SonarService.bat install.

The service runs when I execute \bin\windows-x86-64\SonarService.bat start, but then stops shortly afterwards.

I had a look at the event viewer and noticed a Java error, so I executed \bin\windows-x86-64\StartSonar.bat instead and got this:

2023.02.09 08:31:47 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.02.09 08:31:47 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [C:\sonarqube-]: C:\jdk\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8\sonarqube-\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/ --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/ -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -server -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-;C:\sonarqube-\lib\jdbc\mssql\mssql-jdbc-11.2.2.jre17.jar C:\sonarqube-\temp\sq-process17624096899686017470properties
**WARNING: A terminally deprecated method in java.lang.System has been called**
**WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/C:/sonarqube-**
**WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager**
WARNING: System::setSecurityManager will be removed in a future release
2023.02.09 08:31:51 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.02.09 08:31:51 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.02.09 08:31:51 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

This isn’t my first upgrade, so I’m fairly confident I’ve followed all the steps; I also had to install Java version 17, but I’m confident that was available.

Any thoughts?

Hey there!

Since [Web Server] stopped first, I would suggest checking the logs/web.log of your SonarQube install directory to understand why it failed.

1 Like

OK, that led me to a SQL connection issue, which led me to Stack Overflow (where else?), which led to a solution - all working now, thank you :slight_smile:

1 Like