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
相关推荐
Jtti1 天前
在 Debian 系统上清理缓存的方式和具体操作方法
运维·缓存·debian
伐尘1 天前
【mac】如何在 macOS 终端中高效查找文件:五种实用方法
运维·macos
川石课堂软件测试1 天前
Oracle 数据库如何查询列
linux·数据库·sql·功能测试·oracle·grafana·prometheus
zzu123zsw1 天前
第15章 Jenkins最佳实践
运维·jenkins
万物得其道者成1 天前
Cursor + 云效 DevOps MCP
运维·devops
wanhengidc1 天前
云手机运行是否消耗自身流量?
运维·科技·安全·游戏·智能手机
光电的一只菜鸡1 天前
ubuntu之坑(十九)——VMware虚拟机扩容磁盘
linux·数据库·ubuntu
wanhengidc1 天前
云手机将要面临的挑战有哪些?
运维·网络·安全·游戏·智能手机
岚天start1 天前
网络计算工具ipcalc详解
linux·运维·网络·网关·广播地址·掩码·ipcalc
deeper_wind1 天前
Jenkins主机中安装ansible部署lnmp论坛(小白的”升级打怪“成长之路)
linux·ansible·jenkins