Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring-cloud-gcp-dependencies pom.xml should declare cloud-sql-connector-jdbc-sqlserver like it does with postgres-socket-factory and mysql-socket-factory-connector-j-8 #2871

Open
PaulKlumpp opened this issue May 10, 2024 · 2 comments

Comments

@PaulKlumpp
Copy link

PaulKlumpp commented May 10, 2024

Describe the bug
When we update spring-cloud-gcp-dependencies in our Maven pom.xml, we always need to check for the new version of cloud-sql-connector-jdbc-sqlserver as well, because they are interdependent with class names and methods.

When the last update of spring-cloud-gcp-dependencies to 4.10.2 came, cloud-sql-connector-jdbc-sqlserver prior to 1.18.0 did not work anymore because of missing classes/methods and vice versa.

Sample

Factory method 'criticalDataSource' threw exception with message: com/google/cloud/sql/core/InternalConnectorRegistry
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:646)
... 43 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/google/cloud/sql/core/InternalConnectorRegistry
at com.google.cloud.sql.sqlserver.SocketFactory.

Proposed fix
Add to pom.xml of spring-cloud-gcp-dependencies:

<dependencyManagement>
	<dependencies>
		[...]
		<dependency>
			<groupId>com.google.cloud.sql</groupId>
			<artifactId>cloud-sql-connector-jdbc-sqlserver</artifactId>
			<version>${cloud-sql-socket-factory.version}</version>
		</dependency>
		[...]
	<dependencies>
</dependencyManagement>
@meltsufin
Copy link
Member

Spring Cloud GCP doesn't provide support for SQL Server. So, it doesn't seem to make sense for us to define its version.

@ttosta-google @suztomo Does Cloud SQL have its own BOM that can be referenced? Should SQL connectors be added to Libraries BOM?

@suztomo
Copy link
Contributor

suztomo commented May 10, 2024

Does Cloud SQL have its own BOM that can be referenced?

No that I know of.

Should SQL connectors be added to Libraries BOM?

If Cloud SQL connectors use libraries used in the Libraries BOM, then it shouldn't be added to the Libraries BOM (circular dependencies).

@mpeddada1 mpeddada1 added type: enhancement New feature or request priority: p2 labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants