记一次将spring-boot应用发布到weblogic的步骤以及遇到的问题

本文记录了一次将Spring Boot应用发布到WebLogic服务器的详细步骤,包括创建web.xml和weblogic.xml,调整pom.xml配置,以及在部署过程中遇到的六大问题,如jar缺失和版本冲突,并提供了相应的解决方案。
摘要由CSDN通过智能技术生成

说明

环境
linux:Red Hat 4.8.3-9
weblogic:weblogic 12.1.3
JDK:JDK1.8

程序环境
构建构建:Apache Maven 3.6.1
框架:ijcf 3.2.0(啊,使我们公司的一个内部框架,你可以理解为Spring、Spring-boot、Spring-web、Spring-MVC等对Spring开源框架的二次封装)

应用程序本身是一个后台java应用程序,用户要求必须运行在weblogic中。故将应用改造成web应用程序。

应用发布到weblogic的步骤

第一步:在应用的src/main新建webapp,新建web.xml和weblogic.xml。

  1. web.xml代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>com.sitech.crmmci.lsms2.app.SpringBootWebLogicApplication</param-value>
    </context-param>

    <listener>
<!--
        <listener-class>org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener</listener-class>
-->
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>metricFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>metricFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextAttribute</param-name>
            <param-value>org.springframework.web.context.WebApplicationContext.ROOT</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>appServlet&
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值