首页 / 浏览问题 / 组件GIS / 问题详情
问题:log4j-slf4j-impl cannot be present with log4j-to-slf4j
2EXP 2024年07月18日

问题:log4j-slf4j-impl cannot be present with log4j-to-slf4j

问题详细描述:安装supermap-iobjectsjava-11.1.1-win64-all-Bin,并把Bin目录下的 com.supermap.data.cloudlicense.jar 包打进本地maven仓库,在项目中使用(新建一个springboot2.3.12.RELEASE项目)。启动项目遇到下方错误:

错误详情:


cloudlicense-11.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class
logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class

Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j

注,由于StaticLoggerBinder在cloudlicense-11.1.1.jar包内部,无法通过maven exclusion移除。

2 个回答

您好,如果遇到jar冲突且无法通过maven exclusion处理时,可以考虑手动删除jar中的class文件,之后把jar重新保存作为依赖

希望能帮助到您
855EXP 2024年07月18日

你好,是否有办法,通过仓库的形式引入超图的相关依赖,比如:
 

<repositories>
    <repository>
        <id>osgeo</id>
        <name>OSGeo Release Repository</name>
        <url>https://repo.osgeo.org/repository/release/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>

超图是否有提供了类似的仓库地址,可以直接使用

您好,可以参考https://maven.supermap.io/

遇到了同样的问题,博主解决了嘛
5EXP 2024年09月04日
...