@shinyaz

aws-advanced-jdbc-wrapper pulls in slf4j-api 1.7 and conflicts with HikariCP 6.x

1 min read

Using aws-advanced-jdbc-wrapper 2.6.4 with HikariCP 6.2.1 in the same project produces:

Output
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation

The cause: aws-advanced-jdbc-wrapper pulls in slf4j-api:1.7.36 as a transitive dependency, conflicting with slf4j-simple:2.0.16. Both slf4j-api-1.7.36.jar and slf4j-api-2.0.16.jar end up in target/lib/.

Fix by excluding 1.7 and explicitly declaring slf4j-api 2.0:

pom.xml
<dependency>
    <groupId>software.amazon.jdbc</groupId>
    <artifactId>aws-advanced-jdbc-wrapper</artifactId>
    <version>2.6.4</version>
    <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.16</version>
</dependency>

Remember to run mvn clean package — plain mvn package leaves the old jar in target/lib/.

Share this post

Shinya Tahara

Shinya Tahara

Solutions Architect @ AWS

I'm a Solutions Architect at AWS, providing technical guidance primarily to financial industry customers. I share learnings about cloud architecture and AI/ML on this site.The views and opinions expressed on this site are my own and do not represent the official positions of my employer.