说明
环境
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。
- 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&