springboot项目使用中创InforSuiteAS替换tomcat

06-01 1539阅读

springboot项目使用中创InforSuiteAS替换tomcat

  • 学习地址
  • 一、部署InforSuiteAS
    • 1、部署
    • 2、运行
    • 二、springboot项目打包成war包 特殊处理
      • 1、pom文件处理
        • 1、排除内嵌的tomcat包
        • 2、新增tomcat、javax.servlet-api
        • 3、打包格式设置为war
        • 4、打包后的项目名称
        • 5、启动类修改
          • 1、原来的不动:TransLineApplication
          • 2、新增SpringBootStartApplication
          • 6、打包成war
          • 2、部署到InforsuiteAS
            • 1、ROOT.war中的WEB-INF目录下放入inforsuite-web.xml
            • 2、InforsuiteAS管理页面中进行部署
              • 2.1、先部署war
              • 2.2、修改访问ip、端口
              • 4、启动日志错误处理
              • 3、部署到tomcat中
                • 1、安装tomcat
                • 2、tomcat控制台乱码处理
                • 3、运行
                • 4、修改运行端口

                  学习地址

                  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

                  安装unzip:sudo yum install unzip
                  解压:
                  unzip InforSuiteAS_StE_V10.0.5.3.9.zip
                  

                  解压完成后:

                  springboot项目使用中创InforSuiteAS替换tomcat

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

                  springboot项目使用中创InforSuiteAS替换tomcat

                  2、运行

                  环境准备:jdk8

                  [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

                  springboot项目使用中创InforSuiteAS替换tomcat

                  启动命令:

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

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

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

                  springboot项目使用中创InforSuiteAS替换tomcat

                  springboot项目使用中创InforSuiteAS替换tomcat

                  浏览器输入:

                  https://192.168.145.131:8060/console

                  账号(初始的):inforsAdmin

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

                  登录后:

                  springboot项目使用中创InforSuiteAS替换tomcat

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

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

                  1、pom文件处理

                  1、排除内嵌的tomcat包

                          
                              org.springframework.boot
                              spring-boot-starter-web
                              
                              
                                  
                                      org.springframework.boot
                                      spring-boot-starter-tomcat
                                  
                              
                          
                  

                  2、新增tomcat、javax.servlet-api

                         
                              org.springframework.boot
                              spring-boot-starter-tomcat
                              
                              provided
                          
                          
                              javax.servlet
                              javax.servlet-api
                              3.1.0
                              provided
                          
                  

                  3、打包格式设置为war

                  war
                  

                  springboot项目使用中创InforSuiteAS替换tomcat

                  4、打包后的项目名称

                  		
                          ROOT
                          
                              
                                  org.apache.maven.plugins
                                  maven-compiler-plugin
                                  3.8.1
                                  
                                      1.8
                                      1.8
                                      UTF-8
                                      
                                          
                                              org.mapstruct
                                              mapstruct-processor
                                              1.4.2.Final
                                          
                                          
                                              org.projectlombok
                                              lombok
                                              1.18.26
                                          
                                          
                                              org.projectlombok
                                              lombok-mapstruct-binding
                                              0.2.0
                                          
                                      
                                  
                              
                              
                                  org.springframework.boot
                                  spring-boot-maven-plugin
                                  
                                      
                                      true
                                  
                              
                          
                      
                  

                  5、启动类修改

                  1、原来的不动:TransLineApplication
                  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
                  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

                  springboot项目使用中创InforSuiteAS替换tomcat

                  springboot项目使用中创InforSuiteAS替换tomcat

                  2、部署到InforsuiteAS

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

                  inforsuite-web.xml内容如下:

                  
                           
                  	
                      jdk 
                      org.omg 
                      org.ietf 
                  	org.eclipse
                      META-INF/services     
                  	  
                  		
                  	
                  
                  

                  放入后的截图

                  springboot项目使用中创InforSuiteAS替换tomcat

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

                  2.1、先部署war

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

                  springboot项目使用中创InforSuiteAS替换tomcat

                  部署完成后:

                  springboot项目使用中创InforSuiteAS替换tomcat

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

                  springboot项目使用中创InforSuiteAS替换tomcat

                  2.2、修改访问ip、端口

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

                  ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/c7b3e9d52acd4951988f5de388a4ab48.pngspringboot项目使用中创InforSuiteAS替换tomcat

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

                  springboot项目使用中创InforSuiteAS替换tomcat

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

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

                  4、启动日志错误处理

                  springboot项目使用中创InforSuiteAS替换tomcat

                  问题原因:microprofile-openapi.jar 不是最新版本

                  解决方法:替换该jar包

                  # 日志目录:
                  cd /usr/local/src/inforSuit-as/InforSuiteAS_StE_V10.0.5.3.9/as/domains/domain1/logs
                  # server.log 为当前日志文件,查看当前日志
                  tail -f -n 1000 server.log
                  
                  #1、停服务
                  cd /usr/local/src/inforSuit-as/InforSuiteAS_StE_V10.0.5.3.9/as/bin
                  sh asadmin stop-domain
                  # 2、替换
                  cd /usr/local/src/inforSuit-as/InforSuiteAS_StE_V10.0.5.3.9/as/modules
                  # 备份原来的microprofile-openapi.jar 
                  # 替换最新的microprofile-openapi.jar 
                  # 3、清除缓存
                  cd /as/domains/domain1
                  # 删除 osgi-cache、generated、logs
                  rm -rf osgi-cache/ logs/ generated/
                  # 4、重启
                  cd /usr/local/src/inforSuit-as/InforSuiteAS_StE_V10.0.5.3.9/as/bin
                  sh asadmin start-domain
                  

                  3、部署到tomcat中

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

                  找到/conf/logging.properties

                  # utf-8 修改为 GBK
                  java.util.logging.ConsoleHandler.encoding = GBK
                  
                  3、运行

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

                  springboot项目使用中创InforSuiteAS替换tomcat

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

                  springboot项目使用中创InforSuiteAS替换tomcat

                  springboot项目使用中创InforSuiteAS替换tomcat

                  4、修改运行端口

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

                  springboot项目使用中创InforSuiteAS替换tomcat

免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们。

目录[+]

取消
微信二维码
微信二维码
支付宝二维码