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

slf4j/LoggerFactory: ClassNotFoundException [3.47.1.0] #1222

Closed
BLCK-B opened this issue Dec 21, 2024 · 4 comments
Closed

slf4j/LoggerFactory: ClassNotFoundException [3.47.1.0] #1222

BLCK-B opened this issue Dec 21, 2024 · 4 comments

Comments

@BLCK-B
Copy link

BLCK-B commented Dec 21, 2024

Describe the bug
Latest version 3.47.1.0 causes an exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at org.apache.logging.slf4j.SLF4JLoggerContext.createLogger(SLF4JLoggerContext.java:57)
	at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:51)
	at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:40)
	at org.apache.commons.logging.LogAdapter$Log4jLog.<init>(LogAdapter.java:159)
	at org.apache.commons.logging.LogAdapter$Log4jAdapter.createLog(LogAdapter.java:113)
	at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:95)
	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:59)
	at [email protected]/org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:202)
	at issueRepro.main/org.blck.issuerepro.Main.main(Main.java:10)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 10 more

To Reproduce

git clone https://github.com/BLCK-B/sqliteSLF4Jissue

I just run Main using green arrow in IntelliJ IDEA. bootRun does not trigger this issue.

You can toggle sqlite version in build.gradle.

Environment (please complete the following information):

  • VM: GraalVM 24.02 - Java 22.02
  • sqlite-jdbc version 3.47.1.0

Additional context
81b05ec

@BLCK-B BLCK-B added the triage label Dec 21, 2024
@neoxpert
Copy link

neoxpert commented Jan 1, 2025

While slf4j should be optional, have you tried adding the slf4j-api to your project or a suitable substitute for your logging framework of choice (if used)?

@gotson
Copy link
Collaborator

gotson commented Jan 2, 2025

Doesn't Spring Boot uses SLF4J by default ?

@neoxpert
Copy link

neoxpert commented Jan 2, 2025

Yes it does. As the bootRun task is working (just ran it on my setup), I would say it's an issue within the project setup / IDE but not sqlite-jdbc itself. In the current state, also Eclipse does not properly setup the module path when running Main directly.

@gotson
Copy link
Collaborator

gotson commented Jan 2, 2025

seems indeed like an IDE issue, thus i am closing this.

@gotson gotson closed this as completed Jan 2, 2025
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

3 participants