springboot项目使用中创InforSuiteAS替换tomcat

springboot项目使用中创InforSuiteAS替换tomcat

学习地址

InforSuiteAS是国产付费中间件,对标 tomcat

官网地址:https://www.inforbus.com/

学习:https://www.showapi.com/news/article/679cade04ddd79f11a3ddf44

一、部署InforSuiteAS

准备:

中间件压缩包:InforSuiteAS_StE_V10.0.5.3.9.zip

临时授权文件(买了才有):license.infor

1、部署

系统:centos8

压缩包存放目录(拷贝进去):/usr/local/src/inforSuit-as

powershell 复制代码
安装unzip:sudo yum install unzip
解压:
unzip InforSuiteAS_StE_V10.0.5.3.9.zip

解压完成后:

把临时授权文件放到 as 文件夹下

2、运行

环境准备:jdk8

powershell 复制代码
[root@localhost bin]# java -version
java version "1.8.0_371"
Java(TM) SE Runtime Environment (build 1.8.0_371-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.371-b11, mixed mode)

进入到目录内: /usr/local/src/inforSuit-as/InforSuiteAS_StE_V10.0.5.3.9/as/bin

启动命令:

powershell 复制代码
方式一(窗口关了就停了):
./startas.sh
方式二(官方启动方式,推荐):
sh asadmin start-domain

第一次启动的时候需要设置初始密码,我这里设置的是:!Aa123456@

我之前启动过一次,启动后:

浏览器输入:

https://192.168.145.131:8060/console

账号(初始的):inforsAdmin

密码(刚刚设定的): !Aa123456@

登录后:

二、springboot项目打包成war包 特殊处理

完整资料:https://download.csdn.net/download/chou342175867/90460631

1、pom文件处理

1、排除内嵌的tomcat包

powershell 复制代码
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <!-- 排除内置的tomcat -->
            <exclusions>
                <exclusion>
                    <artifactId>org.springframework.boot</artifactId>
                    <groupId>spring-boot-starter-tomcat</groupId>
                </exclusion>
            </exclusions>
        </dependency>

2、新增tomcat、javax.servlet-api

powershell 复制代码
       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <!-- tomcat范围改成provided,否则后面就会出问题,tomcat无法解析jsp -->
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>

3、打包格式设置为war

powershell 复制代码
<packaging>war</packaging>

4、打包后的项目名称

powershell 复制代码
<build>
		<!--我这里是设置为ROOT,这样部署到tomcat中后,请求地址无需加上项目名称-->
        <finalName>ROOT</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>1.4.2.Final</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.26</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok-mapstruct-binding</artifactId>
                            <version>0.2.0</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- 代表maven打包时会将外部引入的jar包(比如在根目录下或resource文件下新加外部jar包)打包到项目jar,在服务器上项目才能运行 -->
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

5、启动类修改

1、原来的不动:TransLineApplication
powershell 复制代码
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableScheduling
@SpringBootApplication
@EnableSwagger2
public class TransLineApplication {
    public static void main(String[] args) {
        SpringApplication.run(TransLineApplication.class, args);
    }
}
2、新增SpringBootStartApplication
powershell 复制代码
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * 重新写一个类 SpringBootStartApplication,和HeroesApplication平级,
 * TransLineApplication可以不做更改,这个方法更方便,推荐用这个
 */
public class SpringBootStartApplication extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(TransLineApplication.class);
    }
}

6、打包成war


2、部署到InforsuiteAS

1、ROOT.war中的WEB-INF目录下放入inforsuite-web.xml

inforsuite-web.xml内容如下:

powershell 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<inforsuite-web-app>
    <property name="relativeRedirectAllowed" value="true"/>     
	<class-loader delegate="false" />
    <whitelist-package>jdk</whitelist-package> 
    <whitelist-package>org.omg</whitelist-package> 
    <whitelist-package>org.ietf</whitelist-package> 
	<whitelist-package>org.eclipse</whitelist-package>
    <whitelist-package>META-INF/services</whitelist-package>     
	<locale-charset-info>  
		<parameter-encoding default-charset="UTF-8"/>
	</locale-charset-info>
</inforsuite-web-app>

放入后的截图

2、InforsuiteAS管理页面中进行部署

2.1、先部署war

应用程序 --->部署,最后点确定

部署完成后:

点击"访问"按钮,可以看到访问地址,这个是不能访问的

2.2、修改访问ip、端口

配置---》server-config --->HTTP服务 ---》 HTTP监听程序

![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/c7b3e9d52acd4951988f5de388a4ab48.png![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/ce0e3ee5510e42038691efbb1431e0c3.png)

修改:http-listener-1,若有修改ssh的 需要修改 http-listener-2

修改对应的 ip、端口,最后保存;就是你服务器的地址和端口

输入浏览器就可以访问了,输入:http://192.168.145.131:8082

3、部署到tomcat中

1、安装tomcat
2、tomcat控制台乱码处理

找到/conf/logging.properties

powershell 复制代码
# utf-8 修改为 GBK
java.util.logging.ConsoleHandler.encoding = GBK
3、运行

将ROOT.war拷贝到tomcat的webapps目录中

进入到 /bin 目录下,双击"startup.bat"启动

4、修改运行端口

/conf/server.xml 找到端口修改

相关推荐
lang2015092814 小时前
Spring Boot优雅关闭全解析
java·spring boot·后端
刘一说16 小时前
Spring Boot 启动慢?启动过程深度解析与优化策略
java·spring boot·后端
lang2015092817 小时前
Spring Boot缓存机制全解析
spring boot·后端·缓存
摇滚侠17 小时前
Spring Boot 3零基础教程,WEB 开发 默认页签图标 Favicon 笔记29
java·spring boot·笔记
lang2015092817 小时前
Spring Boot SQL数据库全攻略
数据库·spring boot·sql
是梦终空19 小时前
计算机毕业设计241—基于Java+Springboot+vue的爱心公益服务系统(源代码+数据库+11000字文档)
java·spring boot·vue·毕业设计·课程设计·毕业论文·爱心公益系统
泉城老铁1 天前
springboot 对接发送钉钉消息,消息内容带图片
前端·spring boot·后端
qq_12498707531 天前
基于Spring Boot的高校实习实践管理系统(源码+论文+部署+安装)
java·spring boot·后端·毕业设计
韩宁羽1 天前
SpringBoot开发双11商品服务系统[完结19章]
spring boot
半梦半醒*1 天前
Jenkins流水线项目发布
运维·ci/cd·tomcat·jenkins·maven·运维开发