java - H2 数据库出现问题可能已经在使用中

标签 java spring spring-boot h2

我正在尝试使用 H2database 和 Spring-boot 运行应用程序。每次当我在独立的 tomcat 中重新部署应用程序时。最终显示构建失败:

Database may be already in use: "/root/NCRWalmart/walmart-pos-wits-common-configuration/src/main/wits_orch.mv.db". Possible solutions: close all other connection(s); use the server mode [90020-182]

我通过 H2databse 的官方网站并尝试了不同的解决方案,但没有任何效果对我有用。 我尝试在属性文件中使用以下 URL:

spring.datasource.url=jdbc:h2:file:${spring.config.location}/wits_orch;DB_CLOSE_ON_EXIT=true;FILE_LOCK=SOCKET;

有什么解决办法吗?

最佳答案

您可能有另一个进程同时运行相同的 H2 实例。 尝试类似 ps -ef | grep h2 ,它会显示所有使用 h2*.jar 的进程

关于java - H2 数据库出现问题可能已经在使用中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37138459/

相关文章:

java - Google Play 64 位要求

java - ApplicationContextInitializer 相关异常在 STS 中部署到 vFabric tc Server 时

java - 无法将基于 Thymeleaf 的 UI 表单中的值绑定(bind)到 Spring Boot 中的 Controller

java - Spring Batch - JdbcCursorItemReader 使用大型 MySQL 表抛出 OutOfMemoryError

web-services - Web 应用程序在几个同时 HTTP 请求后被破坏

java - 尝试建立 WebSocket 连接时 JWT 身份验证阻止 SockJS 握手

spring-boot - SpringBoot Keycloak NoSuchMethodError : javax. ws.rs.core.UriBuilder.resolveTemplates

java - JADE - 2 个代理之间的并行行为不起作用

java - 电子邮件的附件?

java - 按国家/地区获取日期格式模式