You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

远程Tomcat报java.lang.NoSuchMethodError但本地运行正常求助

问题排查:WAR包本地运行正常,远程Tomcat部署报错NoSuchMethodError

错误信息

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.apache.doris.analysis.SqlParser.getSymbolFactory()Ljava_cup/runtime/SymbolFactory;

已完成的排查动作

  • 确认本地与远程使用的WAR包完全一致
  • 反编译包含SqlParser类的jar包,确认getSymbolFactory()方法存在
  • 将远程部署的WAR包复制回本地运行,无异常
  • 更换远程Tomcat版本为与本地一致,错误仍存在

可疑点:system scope依赖配置

项目中通过system scope导入了resource/lib目录下的jar包,相关Maven配置如下:

<dependency>
    <groupId>net.sourceforge.czt.dev</groupId>
    <artifactId>java-cup</artifactId>
    <version>0.11-a-czt02-cdh</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/resources/lib/java-cup-runtime-0.11-a-czt01-cdh.jar</systemPath>
</dependency>
<dependency>
    <groupId>org.apache.doris</groupId>
    <artifactId>fe-core</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/resources/lib/fe-core-1.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
    <groupId>org.apache.doris</groupId>
    <artifactId>fe-common</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/resources/lib/fe-common-1.0-SNAPSHOT.jar</systemPath>
</dependency>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <nonFilteredFileExtensions>
            <nonFilteredFileExtension>ftl</nonFilteredFileExtension>
        </nonFilteredFileExtensions>
        <outputDirectory>target</outputDirectory>
        <webResources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/webapp/WEB-INF</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <targetPath>/WEB-INF</targetPath>
            </resource>
            <resource>
                <directory>src/main/resources/lib</directory>
                <targetPath>WEB-INF/lib</targetPath>
            </resource>
        </webResources>
    </configuration>
</plugin>

目前已无排查思路,恳请提供解决方向。

内容的提问来源于stack exchange,提问作者Yang Xu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 01:30:49