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

Spring Boot部署Wildfly遇异常:1.5/2.0版本报错,1.2.7可正常启动

Hey Brian, let’s break down what’s happening here and how to fix it.

Core Issue: HttpPutFormContentFilter Class Modifier Change

In Spring Boot 1.2.x (like your working 1.2.7 version), the org.springframework.boot.web.filter.HttpPutFormContentFilter was a non-final class that could be inherited. But starting from Spring Boot 1.3.x (including the 1.5.10.RELEASE and 2.0.0 versions you’re having trouble with), this class was updated to be final.

If your code (or any third-party dependency you’re using) has a custom Filter that extends this class, that’s exactly why you’re seeing the "cannot inherit from final class" exception—it’s a direct conflict with the updated class structure in newer Spring Boot versions.

Step-by-Step Solutions

1. Check Your Code & Dependencies

  • First, scan your own codebase for any class that extends HttpPutFormContentFilter. If you find one, refactor it immediately: instead of inheriting the class, use composition to reuse its logic, or reimplement the Filter interface from scratch based on your needs.
  • If your code doesn’t have such a class, the issue is likely coming from a third-party dependency (like an old custom starter or internal company component). Run a dependency tree check to find the culprit:
    • For Maven: mvn dependency:tree
    • For Gradle: ./gradlew dependencies
      Once you identify the problematic dependency, either:
      • Upgrade it to a version that’s compatible with Spring Boot 1.5+/2.0, or
      • Exclude the default HttpPutFormContentFilter auto-configuration (see step 2) and implement the required functionality yourself.

2. Exclude the Auto-Configuration

If you need to disable the default HttpPutFormContentFilter setup, you can do this in two ways:

Option 1: Annotation on Your Starter Class

Add the exclude to your @SpringBootApplication annotation:

@SpringBootApplication(exclude = HttpPutFormContentFilterAutoConfiguration.class)
public class YourApplication {
    public static void main(String[] args) {
        SpringApplication.run(YourApplication.class, args);
    }
}

Option 2: Property File Configuration

Add this line to your application.properties:

spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.HttpPutFormContentFilterAutoConfiguration

Or in application.yml:

spring:
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.web.HttpPutFormContentFilterAutoConfiguration

After excluding it, you can write a custom Filter to handle PUT request form content if your application still needs that functionality.

3. Verify Dependency Version Compatibility

It’s also worth double-checking that all your project’s dependencies are compatible with your target Spring Boot version. Old versions of Spring Cloud, security libraries, or other Spring ecosystem components can cause version conflicts that lead to weird class-loading errors. Use the dependency tree command mentioned earlier to spot mismatched versions, then adjust them to align with your Spring Boot release.

Quick Tip

When upgrading Spring Boot versions, always review the official Release Notes and pay close attention to the "Breaking Changes" section. This will help you catch API or class structure changes like this one before they cause issues in your project.

内容的提问来源于stack exchange,提问作者Brian S

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.20 08:10:17