Spring Boot application fails to start with error java.lang.ClassNotFoundException: ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP
Asked Answered
W

1

5

Spring Boot (3.3.4) application fails to start with error java.lang.ClassNotFoundException: ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP

ERROR in ch.qos.logback.core.model.processor.ImplicitModelHandler - Could not create component [timeBasedFileNamingAndTriggeringPolicy] of type [ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP] java.lang.ClassNotFoundException: ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP```
Weed answered 24/9 at 11:26 Comment(0)
W
12

The error can be resolved by changing ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP to ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy in your logback-spring.xml or logback.xml.

<rollingPolicy
        class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
    <!-- rollover daily and when the file reaches 10 MegaBytes -->
    <fileNamePattern>${LOGS}/archived/theapp-%d{yyyy-MM-dd}.%i.log
    </fileNamePattern>
    <timeBasedFileNamingAndTriggeringPolicy
            class="ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy">
        <maxFileSize>10MB</maxFileSize>
    </timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
Weed answered 24/9 at 11:26 Comment(1)
Thanks. I've got this error since moving today from Spring-Boot 3.3.3 to 3.3.4.Unceasing

© 2022 - 2024 — McMap. All rights reserved.