From 500f01f5ab858553b95253f81bd2d216cf32dfcf Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Sun, 12 Oct 2025 19:33:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=8D=87=E7=BA=A7to?= =?UTF-8?q?mcat-embed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1530586131300352]升级tomcat-embed http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1530586131300352 --- config/config.properties | 3 +- pom.xml | 19 ++++++++- .../springboot/NeatLogicApplication.java | 40 ++++++++++++++----- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/config/config.properties b/config/config.properties index de84fef..d8e7986 100644 --- a/config/config.properties +++ b/config/config.properties @@ -26,4 +26,5 @@ data.home=/Users/chenqiwei/data/neatlogic/ is.maintenance.mode=true heartbeat.rate=3 heartbeat.threshold=5 -autoexec.token=499922b4317c251c2ce525f7b83e3d94 \ No newline at end of file +autoexec.token=499922b4317c251c2ce525f7b83e3d94 +jwt.secret=neatlogic#neatlogic$secret \ No newline at end of file diff --git a/pom.xml b/pom.xml index 71b677d..620315f 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ 0.4.0.0-SNAPSHOT - 8 - 8 + 17 + 17 UTF-8 @@ -144,6 +144,21 @@ + + org.apache.tomcat.embed + tomcat-embed-core + 9.0.108 + + + org.apache.tomcat.embed + tomcat-embed-el + 9.0.108 + + + org.apache.tomcat.embed + tomcat-embed-websocket + 9.0.108 + com.neatlogic diff --git a/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java b/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java index 6bdddfa..7fac1ab 100644 --- a/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java +++ b/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java @@ -108,15 +108,9 @@ public class NeatLogicApplication { -Dnacos.home=192.168.0.10:8848 -Dnacos.namespace=neatlogic -DenableNoSecret=true - -Xdebug - -Xnoagent - -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 - -XX:+UseConcMarkSweepGC - -XX:+PrintGCDetails - -XX:+PrintGCTimeStamps + -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -XX:+HeapDumpOnOutOfMemoryError - -verbose:gc - -Xloggc:/neatlogic/logs/gc.log + -Xlog:gc*:file=/neatlogic/logs/gc.log:time,uptime,level,tags -Djava.io.tmpdir=/neatlogic/tmp -Djava.awt.headless=true -DenableNoSecret=true @@ -126,7 +120,7 @@ public class NeatLogicApplication { /* 研发环境启动项目 - 用IntelliJ IDEA启动项目时需要将config目录标记为资源根目录,再设置VM options如下: + 用IntelliJ IDEA启动项目时需要将config目录标记为资源根目录(右键config目录 → Mark Directory as → Resources Root),再设置VM options如下: -Dlog4j.home=D:\logs2 -Dlog4j.priority=trace @@ -147,6 +141,34 @@ public class NeatLogicApplication { //确保JVM使用UTF-8编码来解释和处理文本数据,否则可能会导致中文乱码 -Dfile.encoding=UTF-8 */ + + /* + 运行NeatLogicApplication.main方法启动Springboot时报错Error running 'NeatLogicApplication' Error running NeatLogicApplication. Command line is too long. Shorten the command line and rerun. + ‌错误原因‌ + 1.Windows 命令行长度限制‌ + Windows 对命令行参数的总长度限制为 8191 字符‌(CMD)或 32767 字符‌(PowerShell)。 + Spring Boot 项目依赖较多时,生成的类路径(CLASSPATH)可能超过此限制。 + 2.‌触发场景‌ + 项目依赖过多(如大型微服务项目)。 + 使用默认的启动配置(JAR Manifest 模式)。 + ‌解决方案‌ + 1. ‌修改启动配置(推荐)‌ + 在 IDEA 中调整启动配置的 ‌缩短命令行‌ 选项: + 打开 Run/Debug Configurations。 + 找到你的 Spring Boot 启动配置(如 NeatLogicApplication)。 + 在 Modify options 中选择 Shorten command line‌。 + 选择以下模式: + 1.JAR Manifest‌:将类路径写入临时文件(适用于大多数场景)。 + */ + + /* + 运行NeatLogicApplication.main方法启动Springboot项目时报错ERROR: nacos获取不到配置且本地config.properties获取失败,请确认nacos服务是否正常或config.properties文件是否存在,如果存在,文件权限是否正常 + 错误原因‌ + neatlogic-springboot/target/classes目录下没有application.properties、config.properties、logback.xml、serverid.conf这些文件 + 解决方法: + 1.需要将config目录标记为资源根目录(右键config目录 → Mark Directory as → Resources Root) + 2.将neatlogic-springboot/target目录删除,再运行NeatLogicApplication.main方法启动Springboot项目 + */ public static void main(String[] args) { SpringApplication application = new SpringApplication(NeatLogicApplication.class); ConfigurableApplicationContext run = application.run(args); -- Gitee From a3e69e35dc39b0b258aa988b2a42611b390f4384 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 13 Oct 2025 10:57:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=8D=87=E7=BA=A7to?= =?UTF-8?q?mcat-embed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1530586131300352]升级tomcat-embed http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1530586131300352 --- .../springboot/NeatLogicApplication.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java b/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java index 7fac1ab..b955bb3 100644 --- a/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java +++ b/src/main/java/neatlogic/module/springboot/NeatLogicApplication.java @@ -89,7 +89,7 @@ import org.springframework.context.ConfigurableApplicationContext; ) public class NeatLogicApplication { /* - 生产环境部署项目 + Linux环境部署项目 将neatlogic-springboot模块打成neatlogic-springboot-0.4.0.0-SNAPSHOT.jar,随便放在某个目录下,然后将本模块下的config目录复制到该目录下,如下所示: /neatloigc neatlogic-springboot-0.4.0.0-SNAPSHOT.jar @@ -118,6 +118,36 @@ public class NeatLogicApplication { -jar neatlogic-springboot-0.4.0.0-SNAPSHOT.jar */ + /* + Windows环境部署项目 + 将neatlogic-springboot模块打成neatlogic-springboot-0.4.0.0-SNAPSHOT.jar,随便放在某个目录下,然后将本模块下的config目录复制到该目录下,如下所示: + /neatloigc + neatlogic-springboot-0.4.0.0-SNAPSHOT.jar + logs + config + application.properties + config.properties + logback.xml + serverid.conf + + 执行命令时将下面命令转成一行,参数之间用空格隔开 + + java + "-Dlog4j.home=D:\\neatlogic\\logs" + "-Dlog4j.priority=trace" + "-Dfile.encoding=UTF-8" + "-Dnacos.home=192.168.0.10:8848" + "-Dnacos.namespace=neatlogic" + "-DenableNoSecret=true" + "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" + "-XX:+HeapDumpOnOutOfMemoryError" + "-Xlog:gc*:file=D:\\neatlogic\\logs\\gc.log:time,uptime,level,tags" + "-Djava.io.tmpdir=D:\\neatlogic\\tmp" "-Djava.awt.headless=true" + "-DenableNoSecret=true" + "-Xbootclasspath/a:./config" + -jar neatlogic-springboot-0.4.0.0-SNAPSHOT.jar + */ + /* 研发环境启动项目 用IntelliJ IDEA启动项目时需要将config目录标记为资源根目录(右键config目录 → Mark Directory as → Resources Root),再设置VM options如下: -- Gitee