The error message “caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j” occurs when both the log4j-slf4j-impl and log4j-to-slf4j dependencies are present in your project. These two dependencies provide the same functionality and are incompatible with each other.
To resolve this issue, you need to exclude either the log4j-slf4j-impl or log4j-to-slf4j dependency from your project, depending on which one is causing the conflict. You can do this by adding an exclusion configuration in your project’s build file (e.g., pom.xml for Maven projects).
Here is an example of how to exclude the log4j-slf4j-impl dependency using Maven:
<dependencies>
<dependency>
<groupId>your.group.id</groupId>
<artifactId>your.artifact.id</artifactId>
<version>your.version</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
By excluding the log4j-slf4j-impl dependency, your project will only use the log4j-to-slf4j dependency for logging, and the conflict should be resolved.
Same cateogry post
- Addcase cannot be called with two reducers for the same action type
- Uncaught typeerror: failed to resolve module specifier “vue”. relative references must start with either “/”, “./”, or “../”.
- Python setup.py bdist_wheel did not run successfully.
- You may need to restart any open editors for them to read new settings.
- Cannot resolve reference to bean ‘jpasharedem_entitymanagerfactory’ while setting bean property ‘entitymanager’