Skip to content

WildFly server won't start using code after the 12.9.0 preview due to error with ConfigurableRetryLogic #2621

@jocstar

Description

@jocstar

Driver version

This is actually a personal build using the code from the date of this post - the released 12.9.0 preview actually works, but the latest code as of 28/Feb/2025 does not.

SQL Server version

Microsoft SQL Server 2022 (RTM-CU15-GDR) (KB5046862) - 16.0.4155.4 (X64) Oct 18 2024 16:16:11 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Enterprise 10.0 (Build 19045: ) (Hypervisor)

Client Operating System

Windows10

JAVA/JVM version

Adoptium-jdk-21.0.5+11

Table schema

N/A

Problem description

I deployed my own build of the driver based on the latest 12.9.0 preview version to a WildFly server to test out a patch I was working on but the server fails to start up because of an error thrown from the JDBC driver which means it cannot create db connections.

Expected behavior

I don't expect an error looking for a configuration file(?) to prevent the driver from being used

Actual behavior

The WildFly server throws an error and cannot create a database connection at startup.

Error message/stack trace

10:16:39,326 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 103) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
at [email protected]//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:364)
at [email protected]//
<< .. snip - truncated for brevity >>
Caused by: java.nio.file.FileSystemNotFoundException
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:156)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:142)
at java.base/java.nio.file.Path.of(Path.java:209)
at java.base/java.nio.file.Paths.get(Paths.java:98)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic.getCurrentClassPath(ConfigurableRetryLogic.java:293)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic.readFromFile(ConfigurableRetryLogic.java:320)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic.setUpStatementRules(ConfigurableRetryLogic.java:204)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic.(ConfigurableRetryLogic.java:86)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic.getInstance(ConfigurableRetryLogic.java:103)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2592)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:2199)
at com.microsoft.sqlserver.jdbc//com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1320)
at [email protected]//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:335)

Any other details that can be helpful

The key part here is the FileSystemNotFoundException coming from ConfigurableRetryLogic.getCurrentClassPath.
It is failing on the line :
if (Files.isDirectory(Paths
.get(ConfigurableRetryLogic.class.getProtectionDomain().getCodeSource().getLocation().toURI()))) {

The URL has the form jar:file:c:...\mssql-jdbc-12.9.0.jre21-preview.jar and seems to be failing because toURL() is trying to use a ZipFileSystem but doesn't find one registered for the jar file.
When I run the JUnit tests in a dev environment, the URL has the form file:c:...\mssql-jdbc-12.9.0.jre21-preview.jar so is only looking at the file system, not within a jar and so there I don't see the problem.

JDBC trace logs

N/A as its getting a connection that is failing

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Closed Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions