为了账号安全,请及时绑定邮箱和手机立即绑定

由于 servlet-api,SpringBoot 应用程序无法启动

由于 servlet-api,SpringBoot 应用程序无法启动

长风秋雁 2021-09-03 12:33:20
你好,首先为我的英语感到抱歉。我正在尝试启动我的 springboot 应用程序,但由于 servlet-api 3.1 和旧版本冲突而无法启动,但我不知道哪个依赖项因此而发生冲突,希望有人能帮助我。以下是我的 pom 文件详细信息:<dependencies><dependency>  <groupId>javax.servlet</groupId>  <artifactId>javax.servlet-api</artifactId>  <version>3.1.0</version>  <scope>provided</scope></dependency>     <dependency>        <groupId>mysql</groupId>        <artifactId>mysql-connector-java</artifactId>        <scope>runtime</scope>    </dependency>    <dependency>        <groupId>org.apache.derby</groupId>        <artifactId>derby</artifactId>        <scope>runtime</scope>    </dependency>    <dependency>        <groupId>org.hsqldb</groupId>        <artifactId>hsqldb</artifactId>        <scope>runtime</scope>    </dependency>    <dependency>        <groupId>org.postgresql</groupId>        <artifactId>postgresql</artifactId>        <scope>runtime</scope>    </dependency>这是我删除的 spring 依赖项,我使用的是 springboot 2.0.4 和 spring 5。
查看完整描述

3 回答

?
慕哥9229398

TA贡献1877条经验 获得超6个赞

我有一个类似的问题(Sprint Boot 1.5 和 Kettle 8),我发现问题/冲突与水壶核心和水壶引擎有关。


我在这些依赖项中排除了 slf4j 和 servlet:


<!-- Pentaho Kettle -->

<dependency>

    <groupId>pentaho-kettle</groupId>

    <artifactId>kettle-core</artifactId>

    <version>${pentaho-kettle.version}</version>

    <exclusions>

        <exclusion>

            <groupId>org.slf4j</groupId>

            <artifactId>slf4j-api</artifactId>

        </exclusion>

        <exclusion>

            <groupId>org.slf4j</groupId>

            <artifactId>slf4j-log4j12</artifactId>

        </exclusion>

    </exclusions>

</dependency>

<dependency>

    <groupId>pentaho-kettle</groupId>

    <artifactId>kettle-engine</artifactId>

    <version>${pentaho-kettle.version}</version>

    <exclusions>

        <exclusion>

            <groupId>javax.servlet</groupId>

            <artifactId>servlet-api</artifactId>

        </exclusion>

    </exclusions>

</dependency>


查看完整回答
反对 回复 2021-09-03
?
白衣染霜花

TA贡献1796条经验 获得超10个赞

问题是 mondrian 包含一个旧版本的 servlet-ap (v2.4),它没有 getVirtualServerName() 方法


使用以下命令检查与 javax.servlet 的依赖关系:


mvn dependency:tree -Dverbose -Dincludes=javax.servlet


pentaho:mondrian:jar:8.3.0.0-371:compile

       |  +- javax.servlet:servlet-api:jar:2.4:compile

       |  \- javax.servlet:jsp-api:jar:2.0:compile

并排除旧版本,如下例所示:


<dependency>

    <groupId>pentaho-kettle</groupId>

    <artifactId>kettle-engine</artifactId>

    <version>${pentaho-kettle.version}</version>

    <exclusions>

        <exclusion>

            <groupId>javax.servlet</groupId>

            <artifactId>servlet-api</artifactId>

        </exclusion>

    </exclusions>

</dependency>


查看完整回答
反对 回复 2021-09-03
  • 3 回答
  • 0 关注
  • 317 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信