Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM repository WHERE key LIKE ? [42104-214] #34068

Closed
libra146 opened this issue Dec 15, 2024 · 9 comments

Comments

@libra146
Copy link

Question

For English only, other languages will not accept.

Before asking a question, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.

When I introduced the dependency and started the project, it worked fine, but when I stopped the project, there was a table not found error, is my configuration correct?
I searched all the questions but I didn't find the answer
The following is the code that will report an error. Please start it normally and stop it. The problem will occur. I don't know what happened.
Please note that the correct database connection is not configured in the project, but I found that this does not affect the occurrence of this problem.

Why didn't I configure the database connection? Because I configured it normally in another project and configured data encryption. The data encryption scheme works fine. But it still reports that the error table cannot be found when stopping the project. I created the following demo project and found that the same problem would occur, so I reported this problem. Who can help me?

demo.zip

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::               (v2.7.18)

2024-12-15 22:37:36.546  INFO 83222 --- [           main] com.java.encrypt.demo.DemoApplication    : Starting DemoApplication using Java 1.8.0_382 on LLLibra.local with PID 83222 (/Users/b/Downloads/work/code/demo/target/classes started by b in /Users/b/Downloads/work/code/demo)
2024-12-15 22:37:36.547  INFO 83222 --- [           main] com.java.encrypt.demo.DemoApplication    : The following 1 profile is active: "uat"
2024-12-15 22:37:37.038  WARN 83222 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.java.encrypt.demo]' package. Please check your configuration.
2024-12-15 22:37:37.226  INFO 83222 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 65004 (http)
2024-12-15 22:37:37.231  INFO 83222 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-12-15 22:37:37.231  INFO 83222 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.83]
2024-12-15 22:37:37.290  INFO 83222 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-12-15 22:37:37.291  INFO 83222 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 608 ms
2024-12-15 22:37:37.423  INFO 83222 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2024-12-15 22:37:37.531  INFO 83222 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
     /               |         
                        3.5.3.1 
2024-12-15 22:37:38.696  INFO 83222 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 65004 (http) with context path ''
2024-12-15 22:37:38.702  INFO 83222 --- [           main] com.java.encrypt.demo.DemoApplication    : Started DemoApplication in 2.389 seconds (JVM running for 2.815)
2024-12-15 22:37:44.923 ERROR 83222 --- [ionShutdownHook] o.a.s.m.r.s.jdbc.JDBCRepository          : Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed

org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "repository" not found (this database is empty); SQL statement:
DELETE FROM `repository` WHERE `key` LIKE ? [42104-214]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[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]
	at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8385) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8369) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.readTableOrView(Parser.java:8358) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.readTableOrView(Parser.java:8328) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.readSimpleTableFilter(Parser.java:1160) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.parseDelete(Parser.java:1174) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.parsePrepared(Parser.java:774) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214]
	at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214]
	at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na]
	at org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository.delete(JDBCRepository.java:192) ~[shardingsphere-standalone-mode-repository-jdbc-5.5.1.jar:5.5.1]
	at org.apache.shardingsphere.mode.persist.service.ComputeNodePersistService.offline(ComputeNodePersistService.java:191) [shardingsphere-mode-core-5.5.1.jar:5.5.1]
	at org.apache.shardingsphere.mode.manager.ContextManager.close(ContextManager.java:212) [shardingsphere-mode-core-5.5.1.jar:5.5.1]
	at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.close(ShardingSphereDataSource.java:107) [shardingsphere-jdbc-5.5.1.jar:5.5.1]
	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:242) [spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587) [spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559) [spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163) [spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520) [spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156) [spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1120) [spring-context-5.3.31.jar:5.3.31]
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1086) [spring-context-5.3.31.jar:5.3.31]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174) [spring-boot-2.7.18.jar:2.7.18]
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1032) [spring-context-5.3.31.jar:5.3.31]
	at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145) [spring-boot-2.7.18.jar:2.7.18]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_382]
	at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114) [spring-boot-2.7.18.jar:2.7.18]
	at java.lang.Thread.run(Thread.java:750) ~[na:1.8.0_382]

2024-12-15 22:37:44.923  INFO 83222 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2024-12-15 22:37:44.925  INFO 83222 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
@linghengqian
Copy link
Member

linghengqian commented Dec 15, 2024

  • You should convert the zip to git on github so I can view it directly using GitHub codespaces. Downloading the zip is a bit dangerous for developers.

Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed

@libra146
Copy link
Author

  • You should convert the zip to git on github so I can view it directly using GitHub codespaces. Downloading the zip is a bit dangerous for developers.

Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed

Okay, I'll test the code from the master branch and if it happens again I'll upload the code to Github

@libra146
Copy link
Author

libra146 commented Dec 16, 2024

  • You should convert the zip to git on github so I can view it directly using GitHub codespaces. Downloading the zip is a bit dangerous for developers.

Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed

I uploaded the code to Github, I built the code for the master branch in codespaces, installed it into my local repo, but I still get the error
My pom configuration is

<?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.18</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.java.encrypt</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>demo</description>
    <url/>
    <licenses>
        <license/>
    </licenses>
    <developers>
        <developer/>
    </developers>
    <scm>
        <connection/>
        <developerConnection/>
        <tag/>
        <url/>
    </scm>
    <properties>
        <java.version>8</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-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc</artifactId>
            <version>5.5.2-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-resolver-dns-native-macos</artifactId>
            <classifier>osx-aarch_64</classifier>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.3.1</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
            <version>8.0.28</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

The Github address of the code is: https://github.com/libra146/demo

The command I use is: mvnw spring-boot:run

The output is:

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< com.java.encrypt:demo >------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> spring-boot:2.7.18:run (default-cli) > test-compile @ demo >>>
[INFO] 
[INFO] --- resources:3.2.0:resources (default-resources) @ demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO] Copying 1 resource
[INFO] 
[INFO] --- compiler:3.10.1:compile (default-compile) @ demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- resources:3.2.0:testResources (default-testResources) @ demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /workspaces/shardingsphere/demo/demo/src/test/resources
[INFO] 
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< spring-boot:2.7.18:run (default-cli) < test-compile @ demo <<<
[INFO] 
[INFO] 
[INFO] --- spring-boot:2.7.18:run (default-cli) @ demo ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::               (v2.7.18)

2024-12-16 03:05:53.125  INFO 165754 --- [           main] com.java.encrypt.demo.DemoApplication    : Starting DemoApplication using Java 11.0.14.1 on codespaces-d7d021 with PID 165754 (/workspaces/shardingsphere/demo/demo/target/classes started by codespace in /workspaces/shardingsphere/demo/demo)
2024-12-16 03:05:53.134  INFO 165754 --- [           main] com.java.encrypt.demo.DemoApplication    : The following 1 profile is active: "uat"
2024-12-16 03:05:54.776  WARN 165754 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.java.encrypt.demo]' package. Please check your configuration.
2024-12-16 03:05:55.329  INFO 165754 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 65004 (http)
2024-12-16 03:05:55.342  INFO 165754 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-12-16 03:05:55.342  INFO 165754 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.83]
2024-12-16 03:05:55.607  INFO 165754 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-12-16 03:05:55.607  INFO 165754 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1907 ms
2024-12-16 03:05:56.013  INFO 165754 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2024-12-16 03:05:56.193  INFO 165754 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
     /               |         
                        3.5.3.1 
2024-12-16 03:06:00.095  INFO 165754 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 65004 (http) with context path ''
2024-12-16 03:06:00.112  INFO 165754 --- [           main] com.java.encrypt.demo.DemoApplication    : Started DemoApplication in 7.742 seconds (JVM running for 8.633)
^C2024-12-16 03:06:02.463 ERROR 165754 --- [ionShutdownHook] o.a.s.m.r.s.jdbc.JDBCRepository          : Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/c8459768-9953-4cc2-a734-1a72f05f1604 failed

org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "repository" not found (this database is empty); SQL statement:
DELETE FROM `repository` WHERE `key` LIKE ? [42104-214]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[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]
        at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8385) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8369) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.readTableOrView(Parser.java:8358) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.readTableOrView(Parser.java:8328) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.readSimpleTableFilter(Parser.java:1160) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.parseDelete(Parser.java:1174) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.parsePrepared(Parser.java:774) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214]
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214]
        at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na]
        at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na]
        at org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository.delete(JDBCRepository.java:202) ~[shardingsphere-standalone-mode-repository-jdbc-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
        at org.apache.shardingsphere.mode.persist.service.ComputeNodePersistService.offline(ComputeNodePersistService.java:192) ~[shardingsphere-mode-core-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
        at org.apache.shardingsphere.mode.manager.ContextManager.close(ContextManager.java:208) ~[shardingsphere-mode-core-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
        at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.close(ShardingSphereDataSource.java:107) ~[shardingsphere-jdbc-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:242) ~[spring-beans-5.3.31.jar:5.3.31]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587) ~[spring-beans-5.3.31.jar:5.3.31]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559) ~[spring-beans-5.3.31.jar:5.3.31]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163) ~[spring-beans-5.3.31.jar:5.3.31]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520) ~[spring-beans-5.3.31.jar:5.3.31]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156) ~[spring-beans-5.3.31.jar:5.3.31]
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1120) ~[spring-context-5.3.31.jar:5.3.31]
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1086) ~[spring-context-5.3.31.jar:5.3.31]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174) ~[spring-boot-2.7.18.jar:2.7.18]
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1032) ~[spring-context-5.3.31.jar:5.3.31]
        at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145) ~[spring-boot-2.7.18.jar:2.7.18]
        at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
        at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114) ~[spring-boot-2.7.18.jar:2.7.18]
        at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

2024-12-16 03:06:02.464  INFO 165754 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2024-12-16 03:06:02.476  INFO 165754 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15.287 s
[INFO] Finished at: 2024-12-16T03:06:02Z
[INFO] ------------------------------------------------------------------------

Looks like the pom worked, but still errors

@linghengqian
Copy link
Member

@libra146
Copy link
Author

This file is the configuration file of ShardingSphere. It is empty now because it does not affect the recurrence of the problem.
Normally, I would use similar code to read this file and load the real data source. Since this is a demo, I have ignored the contents of this file in order to allow everyone to run normally.
DataSource dataSource = YamlShardingSphereDataSourceFactory.createDataSource(yamlFile);

@linghengqian
Copy link
Member

sdk install java 23-open
sdk use java 23-open
git clone git@github.com:apache/shardingsphere.git
cd ./shardingsphere/
git reset --hard 2108a520547aa5fe14babe9c4eaea7e920507427
./mvnw clean install -Prelease -T1C -DskipTests -Djacoco.skip=true -Dcheckstyle.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
cd ../
git clone git@github.com:linghengqian/demo.git
cd ./demo/
./mvnw clean spring-boot:run
  • I executed Ctrl+C 1 minute after startup to ensure that the shardingsphere metadata was fully loaded. If you don't execute SQL additionally, it is obviously unknown when shardingsphere will finish loading the metadata, because the h2database in memory mode is not as performant as you think.
2024-12-16 12:25:31.937  INFO 75588 --- [           main] com.java.encrypt.demo.DemoApplication    : Started DemoApplication in 2.948 seconds (JVM running for 3.217)
^C2024-12-16 12:26:23.561  INFO 75588 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2024-12-16 12:26:23.564  INFO 75588 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

@libra146
Copy link
Author

I upgraded the version of h2, and it is working normally now, thank you for your help! I will try to find out where the lower version of h2 was introduced.

By the way, when will the 5.5.2 version be released?

@linghengqian
Copy link
Member

I will try to find out where the lower version of h2 was introduced.

  • Your project parent pom is org.springframework.boot:spring-boot-dependencies:2.7.18 and h2.version is of course defined there. Feel free to check out the Maven 3 documentation. The ASF doesn't actually have infrastructure documentation for Maven 4 yet.

By the way, when will the 5.5.2 version be released?

@libra146
Copy link
Author

Alright, thank you again for solving my problem. I will close this issue as it has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants