fisco-bcos 关于服务bash status.sh启动runing 中但是5002端口监听不到,出错的问题

bash status.sh =============================================================================================== Server com.webank.webase.front.Application Port 5002 is running PID(4587) ===============================================================================================

yjm@yjm-VMware-Virtual-Platform:~/webase-front$ sudo netstat -anlp | grep 5002 没有端口信息输出

此时可以查看log文件夹下的WeBASE-front.log,找到报错信息如下
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-04-09 19:51:16.519 [main] ERROR SpringApplication() - Application run failed java.lang.IllegalStateException: Failed to execute CommandLineRunner Caused by: org.h2.jdbc.JdbcSQLNonTransientException: The database is read only; SQL statement: INFO LocalContainerEntityManagerFactoryBean() - Closing JPA EntityManagerFactory for persistence unit 'default' 2025-04-09 19:51:16.563 [main] INFO HikariDataSource() - HikariPool-1 - Shutdown initiated... 2025-04-09 19:51:16.570 [main] INFO HikariDataSource() - HikariPool-1 - Shutdown completed.

解决方案:(注意更换自己问件路径,我的webase-front目是在/home/yjm文件夹下)

强制停止残留进程

sudo pkill -9 -f "com.webank.webase.front.Application"

确认无相关进程

ps -ef | grep webase-front

复制代码
# 删除锁文件(关键步骤)
sudo rm -f /home/yjm/webase-front/h2/*.lock.db
sudo rm -f /home/yjm/webase-front/h2/*.trace.db

修改配置文件sudo nano /home/yjm/webase-front/conf/application.yml

javascript 复制代码
spring:
  datasource:
    url: jdbc:h2:file:/home/yjm/webase-front/h2/webasefront;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE  # 添加AUTO_SERVER
    hikari:
      connection-init-sql: "SET MODE MySQL"  # 添加此配置

再启动服务

javascript 复制代码
bash start.sh

# 实时查看日志
tail -f log/Webase-Front.log
相关推荐
Johny_Zhao9 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒2 天前
OpenClaw 多 Agent 配置实战指南
运维
深紫色的三北六号2 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash2 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI3 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行4 天前
Linux和window共享文件夹
linux
木心月转码ing4 天前
WSL+Cpp开发环境配置
linux