Getting Slf4J error in SpringBoot

Error is
Exception in thread "main" java.lang.AbstractMethodError: Receiver class org.springframework.boot.logging.logback.RootLogLevelConfigurator does not define or inherit an implementation of the resolved method 'abstract void configure(ch.qos.logback.classic.LoggerContext)' of interface ch.qos.logback.classic.spi.Configurator.
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:156)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
at com.pchf.avkashservice.AvkashServiceApplication.<clinit>(AvkashServiceApplication.java:17)

Process finished with exit code 1
Exception in thread "main" java.lang.AbstractMethodError: Receiver class org.springframework.boot.logging.logback.RootLogLevelConfigurator does not define or inherit an implementation of the resolved method 'abstract void configure(ch.qos.logback.classic.LoggerContext)' of interface ch.qos.logback.classic.spi.Configurator.
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:156)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
at com.pchf.avkashservice.AvkashServiceApplication.<clinit>(AvkashServiceApplication.java:17)

Process finished with exit code 1
attached my pom.xml
17 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @oneplusiota! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2y ago
you have version incompatibilities
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st2y ago
No description
No description
dan1st
dan1st2y ago
yeah basically remove all <version> declarations that aren't needed i.e. all of spring/jakarta dependencies except the <parent>
dan1st
dan1st2y ago
like that
dan1st
dan1st2y ago
maybe also for micrometer etc
Crain
Crain2y ago
Let Spring manage your Spring versions. It'll make your life so much eaiser
lars
larsOP2y ago
Now it's throwing this error
✗ avkash-service (main) ✗ mvn clean
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'dependencies.dependency.version' for org.jetbrains:annotations:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 1, column 1952
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-openfeign:jar is missing. @ line 1, column 2151
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.pchf:avkash-service:0.0.1-SNAPSHOT (/Users/shivam.nayak/Documents/piramal/avkash-service/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-openfeign:jar is missing. @ line 1, column 2151
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
✗ avkash-service (main) ✗ mvn clean
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'dependencies.dependency.version' for org.jetbrains:annotations:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 1, column 1952
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-openfeign:jar is missing. @ line 1, column 2151
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.pchf:avkash-service:0.0.1-SNAPSHOT (/Users/shivam.nayak/Documents/piramal/avkash-service/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-openfeign:jar is missing. @ line 1, column 2151
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Crain
Crain2y ago
You need to bring in the Spring Cloud Pom reference
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
And specify your Spring Cloud version. I wish Spring would fix that.
lars
larsOP2y ago
yeah it works but a new error came.
lars
larsOP2y ago
Here's the error.
dan1st
dan1st2y ago
It seems you have a class AuthClientHelper Is it annotated with some Spring annotation like @Component? Is there any @Bean method returning an AuthClientHelper?
lars
larsOP2y ago
I am using it like this
@Service
@Slf4j
@RequiredArgsConstructor
public class AdminService {
private final AuthClientHelper authClientHelper;
private final AdminServiceClient adminServiceClient;
...
...
@Service
@Slf4j
@RequiredArgsConstructor
public class AdminService {
private final AuthClientHelper authClientHelper;
private final AdminServiceClient adminServiceClient;
...
...
dan1st
dan1st2y ago
yes but where did you declare the bean? Is there a method like @Bean public AuthClientHelper authClientHelper() or similar somewhere?
lars
larsOP2y ago
My mistake I duplicated the file in another package that's why it was throwing an error. It works now
JavaBot
JavaBot2y ago
Post Closed
This post has been closed by <@988114355382022254>.
Want results from more Discord servers?
Add your server