Kusum
Kusum

Reputation: 271

Migrating spring to spring boot web app! Removed mongodb and added Postgres settings

Caused by: java.lang.NoClassDefFoundError: ch/qos/logback/classic/Logger
        at com.calamp.common.springboot.dbproperties.DBPropertySourceLoader.<clinit>(DBPropertySourceLoader.java:25)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:135)
        ... 28 more
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.Logger
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139)
        ... 35 more

Upvotes: 0

Views: 70

Answers (1)

Tobi Nonymous
Tobi Nonymous

Reputation: 611

Short answer: Your project is missing the logback-classic dependency:

<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.2.3</version>
    <scope>test</scope>
</dependency>

I guess you are not using any dependency management tool like Maven, Gradle or Ivy, that resolves transitive dependencies automatically. In your place I would look into those tools (it's probably best to start with Maven) instead of managing your dependencies yourself.

Upvotes: 1

Related Questions