Environment:A616567126 GPT WEB JAVA Spring Boot Runtime
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Web_Application |
| Last Updated | 2026-10-13 18:00 GMT |
Overview
Spring Boot 2.3.2 runtime on Java 8 with embedded Tomcat, serving the GPT-WEB-JAVA AI bot application on port 8081.
Description
This environment provides the core application runtime for the GPT-WEB-JAVA intelligent bot platform. It is built on Spring Boot 2.3.2.RELEASE with Java 8 (source and target level 8), using the spring-boot-starter-parent POM. The application runs on an embedded Tomcat server with UTF-8 URI encoding and exposes REST APIs on port 8081. It includes Spring MVC, AOP, validation, WebSocket, mail, and configuration processor starters. The build system is Maven, with the spring-boot-maven-plugin packaging the application as an executable JAR.
Usage
Use this environment for all GPT-WEB-JAVA implementations. Every controller, service, and utility in the codebase runs within this Spring Boot context. It is the mandatory base runtime for any deployment.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux (CentOS/RHEL recommended) | start.sh uses yum-based install; Windows/macOS supported for dev |
| Hardware | 2+ CPU cores, 2GB+ RAM | Handles concurrent SSE streams and Discord WSS connections |
| Disk | 10GB+ | For application JAR, uploaded images, and logs |
| Java | JDK 8 | start.sh installs java-1.8.0-openjdk; pom.xml specifies java.version=8 |
| Port | 8081 (TCP) | Configurable in application.yml |
Dependencies
System Packages
- `java-1.8.0-openjdk` = 1.8.x
- `maven` >= 3.9.2 (build time only)
Java Packages (Maven)
- `spring-boot-starter-parent` = 2.3.2.RELEASE
- `spring-boot-starter-web`
- `spring-boot-starter-validation`
- `spring-boot-starter-aop`
- `spring-boot-starter-websocket`
- `spring-boot-starter-mail`
- `spring-boot-configuration-processor`
- `lombok`
- `fastjson` = 2.0.23
- `hutool-all` = 5.8.12
- `httpclient5` = 5.2.1
- `jtokkit` = 0.4.0
- `thumbnailator` = 0.4.14
- `dataurl` = 2.0.0
- `UserAgentUtils` = 1.21
- `com.google.zxing:core` = 3.5.1
Credentials
The following configuration items must be set in `application.yml` or `application-prod.yml`:
- `wx.mp.app-id`: WeChat Official Account App ID
- `wx.mp.secret`: WeChat Official Account App Secret
- `wx.mp.token`: WeChat Official Account verification token
No environment variables are used directly; all credentials are stored in MySQL (`sys_config` and `pay_config` tables) and loaded into Redis at startup.
Quick Install
# Install JDK 8 (CentOS/RHEL)
yum install java-1.8.0-openjdk* -y
# Install Maven
wget https://dlcdn.apache.org/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz
tar -xvf apache-maven-3.9.2-bin.tar.gz
mv apache-maven-3.9.2 /usr/local/
export PATH=$PATH:/usr/local/apache-maven-3.9.2/bin
# Build the project
mvn clean && mvn compile && mvn install
# Run
java -jar -Dfile.encoding=utf-8 target/Intelligent-Bot-0.0.1-SNAPSHOT.jar \
--spring.config.location=/usr/local/siana/application-prod.yml
Code Evidence
Spring Boot version and Java version from `pom.xml:8-18`:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
</parent>
<properties>
<java.version>8</java.version>
</properties>
Server configuration from `application.yml:1-4`:
server:
port: 8081
tomcat:
uri-encoding: utf-8
Compiler target from `pom.xml:209-213`:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `Port 8081 already in use` | Another process occupies port 8081 | Change `server.port` in application.yml or stop the conflicting process |
| `No qualifying bean of type` | Spring context failed to wire a dependency | Ensure all `@Component`, `@Service` annotations are present and component scanning covers the package |
| `OutOfMemoryError: Java heap space` | Insufficient heap for concurrent image processing | Increase JVM heap with `-Xmx2g` or higher |
| `ClassNotFoundException: com.alibaba.fastjson.JSON` | fastjson dependency missing | Verify `com.alibaba:fastjson:2.0.23` is in pom.xml |
Compatibility Notes
- Java 9+: Not tested; pom.xml explicitly targets Java 8. May work but is unsupported.
- Spring Boot 3.x: Not compatible — requires Java 17+ and uses jakarta.* packages instead of javax.*.
- Windows: Dev environment works; prod deployment uses Linux (CentOS) per start.sh.
- Timezone: Application defaults to GMT+8 (Asia/Shanghai); ensure server timezone matches for correct billing and task timestamps.
Related Pages
- Implementation:A616567126_GPT_WEB_JAVA_GptController
- Implementation:A616567126_GPT_WEB_JAVA_ChatGPTStream
- Implementation:A616567126_GPT_WEB_JAVA_ConsoleStreamListener
- Implementation:A616567126_GPT_WEB_JAVA_MjController
- Implementation:A616567126_GPT_WEB_JAVA_SdController
- Implementation:A616567126_GPT_WEB_JAVA_AuthController
- Implementation:A616567126_GPT_WEB_JAVA_CheckService
- Implementation:A616567126_GPT_WEB_JAVA_InitUtil
- Implementation:A616567126_GPT_WEB_JAVA_SendMessageUtil
- Implementation:A616567126_GPT_WEB_JAVA_OrderServiceImpl
- Implementation:A616567126_GPT_WEB_JAVA_AsyncService
- Implementation:A616567126_GPT_WEB_JAVA_BaiduServiceImpl
- Implementation:A616567126_GPT_WEB_JAVA_NotifyServiceImpl
- Implementation:A616567126_GPT_WEB_JAVA_BannedPromptUtils
- Implementation:A616567126_GPT_WEB_JAVA_CardPinServiceImpl
- Implementation:A616567126_GPT_WEB_JAVA_WxServiceImpl
- Implementation:A616567126_GPT_WEB_JAVA_WxOutServiceImpl
- Implementation:A616567126_GPT_WEB_JAVA_WxApi
- Implementation:A616567126_GPT_WEB_JAVA_MyTask
- Implementation:A616567126_GPT_WEB_JAVA_JwtUtil
- Implementation:A616567126_GPT_WEB_JAVA_AuthorizationInterceptor
- Implementation:A616567126_GPT_WEB_JAVA_WxPayUtil