org.h2.jdbc.JdbcSQLNonTransientException: 一般错误: "java.lang.UnsupportedOperationException" [50000-214



我正在使用Springboot创建一个应用程序。我使用H2数据库作为2.1.214版本的依赖项。我得到以下错误-

2022-07-26 17:38:24.039  INFO 5308 --- [           main] c.e.E.EmployeeApplication                : Starting EmployeeApplication using Java 17.0.4 on DESKTOP-2NJA7RF with PID 5308 (E:SpringBoot ProjectsEmployeeApplicationtargetclasses started by HP in E:SpringBoot ProjectsEmployeeApplication)
2022-07-26 17:38:24.039  INFO 5308 --- [           main] c.e.E.EmployeeApplication                : No active profile set, falling back to 1 default profile: "default"
2022-07-26 17:38:25.334  INFO 5308 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-07-26 17:38:25.427  INFO 5308 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 80 ms. Found 1 JPA repository interfaces.
2022-07-26 17:38:26.521  INFO 5308 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2022-07-26 17:38:26.536  INFO 5308 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-07-26 17:38:26.536  INFO 5308 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.65]
2022-07-26 17:38:26.724  INFO 5308 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-07-26 17:38:26.724  INFO 5308 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2566 ms
2022-07-26 17:38:26.849  INFO 5308 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2022-07-26 17:38:27.993 ERROR 5308 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.UnsupportedOperationException" [50000-214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:554) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214]

我不明白这是什么意思。我已经搜索了关于Hikaripool的堆栈溢出,但无法找到解决此问题的方法。application.properties为-

spring.h2.console.enabled=true
spring.datasource.platform=h2
spring.datasource.url=jdbc:h2:mem:course-library-management-system;MV_STORE=false
spring.jpa.hibernate.ddl-auto=update

pom.xml依赖项是-

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.employee</groupId>
<artifactId>EmployeeApplication</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>EmployeeApplication</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.214</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

您需要从JDBC连接URL中删除MV_STORE=FALSE,H2 2.*.*中没有这样的设置。这些版本只有基于MVStore的备份。

相关内容

  • 没有找到相关文章

最新更新