Initialization of bean failed; nested exception is java.lang.IllegalStateException: Fail to connect

sonarqube-developer-9.6.1.59531
Windows Server 2022
Sql Server 2019
jdk-17_windows-x64_bin

Good morning community.

I am installing a SonarQube from scratch, but in the step of executing c:\sonarqube\bin\windows-x86-64\StartSonar.bat

the web.log file tells me the following:

Error creating bean with name ‘jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.db.DefaultDatabase’: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Fail to connect to database

any ideas?

sonar.properties

sonar.jdbc.url=jdbc:sqlserver://SONARQUBE01;databaseName=SonarQube;integratedSecurity=false;
sonar.jdbc.username=xxx
sonar.jdbc.password=xxx

Thank you
Dario Flores

Hi Dario,

Welcome to the community!

If you look more closely at that error in your log, you should see more specific details. (Focus on the lines that start with “Caused by” and scroll to the right to get to the end of the line.)

 
HTH,
Ann

I found this

Caused by: java.lang.IllegalStateException: Fail to connect to database
	at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:86)
	
Caused by: java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
	
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:b6da69ea-d896-4183-b425-d1a01ea7c25f)
	
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:b6da69ea-d896-4183-b425-d1a01ea7c25f
	
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Thank you very much for your time

Hi,

Thanks for the details. See if the Upgrade Notes for 9.6 help.

 
Ann

Thank you very much with these guidelines I could at least change the error.

Thanks for your time Ann.

1 Like

Hi,

I’m glad it got you further along. Feel free to create a new thread for the new error.

 
Ann

1 Like