1、背景
国家近年来大力推进信息技术应用创新产业(信创),要求关键领域采用自主可控的国产软硬件。Tomcat作为国外开源产品,存在潜在的安全风险和技术依赖。TongWeb作为国产中间件,符合信创目录要求,满足政府对数据安全和供应链安全的监管要求。
官网地址
https://www.tongtech.com/
2、安装依赖
安装到本地仓库
运行 “installAll-8.0.E.3_P2” 安装脚本,将 lib 下的 jar 包安装到本地 maven 仓库。Linux 环境安装
./installAll-8.0.E.3_P2.sh
安装到企业私仓
使用 “deployAll-8.0.E.3_P2” 脚本,解压 TongWeb 嵌入式版资源包,并将 lib 目录中的 jar 包安装到远端nexus 或兼容 nexus 企业私有仓库。
deployAll-8.0.E.3_P2.sh [url] [sid]
- url:需要上传的企业私仓地址。
- 注意:必须输入企业私仓完整路径信息。
- sid:maven 的 “setting.xml” 中配置的 <server> 标签下的 id 信息。
- 注意:必须在 “setting.xml” 中配置企业私仓密钥信息。
示例
./deployAll-8.0.E.3_P2.sh http://127.0.0.1:8081/nexus/content/repositories/central/ central
3、引入依赖
pom.xml 中直接配置依赖
引入依赖 Tongweb-Spring-Boot-Starter,直接在工程的 pom.xml 中添加 tongweb-spring-boot-starter 和嵌入式版 TongWeb 的依赖,同时,排除掉Spring Boot 自带的 tomcat 的依赖。以springboot3.x为例
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><exclusion><artifactId>spring-boot-starter-tomcat</artifactId><groupId>org.springframework.boot</groupId></exclusion></exclusions>
</dependency>
<!--东方通start-->
<!-- 添加tongweb-spring-boot-starter依赖 -->
<dependency><groupId>com.tongweb.springboot</groupId><artifactId>tongweb-spring-boot-starter-3.x</artifactId><version>8.0.E.3_P2</version>
</dependency>
<!--东方通end-->
4、License 授权认证
TongWeb 支持以下两种授权认证方式:
- 本地认证 - 通过本地 license.dat 文件认证
- 远程认证 - 通过 License Server 远程认证
本文讲的是本地认证。
本地认证
配置 license 存放路径
授权文件(license.dat)放入 “工程/resources” 目录。
server:tongweb:license:path: classpath:license.dat #配置为 license.dat 存放路径。type: file #配置为 “file”,表示本地认证。
5、启动
启动日志
------------------------------------------------------
------------------< 授 权 证 书 >-------------------
---------------------- 产 品 -----------------------
产 品 TongWeb
版 本 Embed
版 本 号 8.0.E
---------------------- 授 权 -----------------------
授 权 类 型 trial
校 验 类 型 file
最 大 实 例 数 无 限
生 成 时 间 2025-06-10
授 权 有 效 期 2025-09-10
---------------------- 客 户 -----------------------
客 户 东方通
项 目 测试
-------------------------------------------------------
------------------< 授 权 证 书 >-------------------
-------------------------------------------------------
6、参考文档
000_TongWeb_V8.0嵌入式版_产品介绍_80E3_P2A01.pdf
002_TongWeb_V8.0嵌入式版_JakartaEE标准容器用户指南_80E3_P2A01.pdf