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

Spring Boot部署至WebLogic 10.3失败:AppMerge流程推进异常

我之前踩过Spring Boot 2.x部署到WebLogic 10.3.6的坑,结合你的情况给你梳理几个核心解决要点:

核心问题根源

WebLogic 10.3.6是基于Java EE 5、Servlet 2.5规范的老版本服务器,而Spring Boot 2.0.0最低要求Servlet 3.1,这是最本质的兼容性冲突,也是部署失败的核心原因。下面是具体的解决步骤:

1. 版本适配调整

如果可以接受降级,直接把Spring Boot版本降到1.5.x系列,这个版本原生支持Servlet 2.5,和WebLogic 10.3.6的兼容性会好很多。如果必须使用2.0.0,就得做下面的适配配置。

2. WAR包打包配置修正

主类继承SpringBootServletInitializer

确保你的应用主类继承SpringBootServletInitializer并重写configure方法,让WebLogic能正确识别Spring Boot应用:

@SpringBootApplication
public class YourRestApplication extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(YourRestApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(YourRestApplication.class, args);
    }
}

Maven依赖调整(Gradle同理)

  • 打包类型设为war
  • 排除内嵌Tomcat依赖,避免和WebLogic的容器冲突
  • 添加Servlet 2.5的API依赖(scope设为provided,让WebLogic提供该类库)
<packaging>war</packaging>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

3. WebLogic专属配置文件

在src/main/webapp/WEB-INF下创建weblogic.xml,解决类加载冲突和Servlet版本适配问题:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd">
    <!-- 设置应用的访问上下文路径 -->
    <context-root>/your-rest-app</context-root>
    <container-descriptor>
        <!-- 优先加载WEB-INF下的类,避免WebLogic自带类库和应用依赖冲突 -->
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
        <!-- 允许读取归档文件的真实路径 -->
        <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    </container-descriptor>
</weblogic-web-app>

4. 日志排查补充

你提到的netuix开头的警告是WebLogic控制台UI组件的日志,不是应用启动失败的直接原因。建议去WebLogic服务器的日志目录(domain/servers/[server-name]/logs/[server-name].log)找包含Exception或Error的条目,那才是导致应用加载停滞的具体异常信息,比如类找不到、依赖冲突等。

内容的提问来源于stack exchange,提问作者osama yaccoub

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.25 06:43:09