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

Java SDK dependencies include SLF4J bindings which conflict with client bindings #31

Open
andrew-bate-rai opened this issue Dec 2, 2022 · 1 comment
Assignees

Comments

@andrew-bate-rai
Copy link
Contributor

The current dependencies of the Java SDK include the SJF4J Simple bindings for SLF4J:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.25</version>
</dependency>

The problem with including this as a dependency is that a client using the Java SDK may wish to specify their own SLF4J bindings.

For example, if a client specifies Logback Classic as the SLF4J bindings with

<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.2.11</version>
</dependency>

then you will get the following warnings:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/rai/.m2/repository/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/rai/.m2/repository/org/slf4j/slf4j-simple/1.7.36/slf4j-simple-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

I encountered this when working on an actual client project that uses the Java SDK.

I think instead we should have a dependency on the SLF4J API but should avoid specifying any particular bindings in the Java SDK itself. For example, we should use the dependency:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.36</version>
</dependency>
@billscheidel-rai
Copy link

Note: This issue has been migrated to https://relationalai.atlassian.net/browse/RAI-8133.

This link is only accessible to employees of RelationalAI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants