一.修改pom.xml文件依赖

1.排除springboot内置tomcat依赖
2.添加tongwebspringbootstartertongwebembed依赖
特别说明下:我这里所有依赖的包都传到了私有仓库,直接复制pom.xml文件import失败

<!-- SpringBoot Web容器 -->
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
   <!--排除自带tomcat依赖-->
   <exclusions>
       <exclusion>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-tomcat</artifactId>
       </exclusion>
   </exclusions>
</dependency>
<!-- 添加 tongweb-spring-boot-starter 依赖 -->
<dependency>
    <groupId>com.tongweb.springboot</groupId>
        <artifactId>tongweb-spring-boot-starter-2.x</artifactId>
            <version>7.0.E.5</version>
</dependency>
<!-- 添加嵌入式版 TongWeb 依赖 -->
<dependency>
    <groupId>com.tongweb</groupId>
        <artifactId>tongweb-embed</artifactId>
            <version>7.0.E.5</version>
</dependency>
<dependency>
    <groupId>com.tongweb</groupId>
    <artifactId>tongweb-javax-servlet</artifactId>
    <version>4.0.0</version>
</dependency>
<dependency>
    <groupId>com.tongweb</groupId>
    <artifactId>tongweb-embed-servlet</artifactId>
    <version>7.0.E.5_P2</version>
</dependency>
<dependency>
    <groupId>com.tongweb</groupId>
    <artifactId>tongweb-embed-javax</artifactId>
    <version>7.0.E.5_P2</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>com.tongweb</groupId>
    <artifactId>tongweb-javax-security-auth-message-api</artifactId>
    <version>1.1.0</version>
</dependency>

二.修改application.yml文件

1.注释掉原来tomcat相关配置
2.添加tongweb的相关配置
3添加tongweb的本地认证配置,将认证文件license.dat放到resources文件夹
配置server.tongweb.license.type = file 时,表示 license 认证方式本地认证
通过配置server.tongweb.license.path配置文件存放路径

server:
#  tomcat:
#    # tomcat的URI编码
#    uri-encoding: UTF-8
#    # tomcat最大线程数,默认为200
#    max-threads: 800
#    # Tomcat启动初始化线程数,默认值25
#    min-spare-threads: 30
  tongweb:
    license:
      type: file
      path: classpath:license.dat
    uri-encoding: utf-8
    max-threads: 800

三.遇到的问题

依据官方文档添加完依赖后,启动项目失败查看最后报错:ClassNotFoundException,有类找不到,应该是还有包没有导全,查看官方给的压缩包,找到缺少的包(pom.xml文件最后加的四个依赖),增加依赖之后,项目正常启动
在这里插入图片描述

原文地址:https://blog.csdn.net/hs_mumuge/article/details/128799143

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_24142.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注