gpt4 book ai didi

java - 为持久性单元 'default' 关闭 JPA Entity_Manage_Factory

转载 作者:行者123 更新时间:2023-12-05 01:56:58 25 4
gpt4 key购买 nike

我在尝试构建、编译和验证时没有出现错误
但是当我尝试使用 Maven 运行这个项目时,开始出现“关闭 JPA EntityManagerFactory for persistence unit 'default'HikariPool-1 - 关闭启动,HikariPool-1 - 关闭完成“

任何人都可以帮助解决这个问题,在此先感谢

"C:\Program Files\Java\jdk1.8.0_301\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:51659,suspend=y,server=n -javaagent:C:\Users\suyash.shrivastava\AppData\Local\JetBrains\IdeaIC2021.2\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.1\lib\idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper C:\Users\suyash.shrivastava\AppData\Local\Temp\idea_classpath1870814817 com.trianz.datamesh.DatameshApplication C:/Users/suyash.shrivastava/.m2/repository
Connected to the target VM, address: '127.0.0.1:51659', transport: 'socket'
20:59:59.723 [main] INFO com.trianz.datamesh.DatameshApplication - Application Started.....

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

2021-10-18 21:00:08.117 INFO 8108 --- [ main] com.trianz.datamesh.DatameshApplication : Starting DatameshApplication using Java 1.8.0_301 on Tri02L-DHW2R93 with PID 8108 (C:\Users\suyash.shrivastava\Documents\DataMesh\target\classes started by suyash.shrivastava in C:\Users\suyash.shrivastava\Documents\DataMesh)
2021-10-18 21:00:08.119 INFO 8108 --- [ main] com.trianz.datamesh.DatameshApplication : The following profiles are active: local
2021-10-18 21:00:10.489 INFO 8108 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-10-18 21:00:11.144 INFO 8108 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 622 ms. Found 4 JPA repository interfaces.
2021-10-18 21:00:14.345 INFO 8108 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-10-18 21:00:14.641 INFO 8108 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.32.Final
2021-10-18 21:00:15.300 INFO 8108 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-10-18 21:00:16.082 INFO 8108 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-10-18 21:00:16.809 INFO 8108 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-10-18 21:00:16.884 INFO 8108 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
Hibernate: create table dm_dataset (id bigint generated by default as identity, athena_query_sql varchar(255), column_list_with_types varchar(255), dataset_name varchar(255), db_sql varchar(255), description varchar(255), frequency varchar(255), schema_path varchar(255), table_name varchar(255), datasource_id bigint not null, primary key (id))
Hibernate: create table dm_datasource (datasource_id bigint generated by default as identity, athena_data_source_name varchar(255), database varchar(255), db_type varchar(255), description varchar(255), host varchar(255), name varchar(255), password varchar(255), schema varchar(255), username varchar(255), domain_id bigint not null, primary key (datasource_id))
Hibernate: create table dm_domain (domain_id bigint generated by default as identity, domain_description varchar(255), domain_name varchar(255), domain_owner varchar(255), frequency varchar(255), primary key (domain_id))
Hibernate: create table udfdgrules (id bigint generated by default as identity, apply_column_name varchar(255), udf_alias_inaws varchar(255), udf_input_parameter_type varchar(255), udf_name varchar(255) not null, udf_return_type varchar(255), user_id bigint not null, primary key (id))
Hibernate: alter table dm_dataset add constraint FK3q5ryjfrcurqxid5bd303a88y foreign key (datasource_id) references dm_datasource
Hibernate: alter table dm_datasource add constraint FKhcev25r3f4d74aaf63rec8786 foreign key (domain_id) references dm_domain
2021-10-18 21:00:20.863 INFO 8108 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-10-18 21:00:20.903 INFO 8108 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-10-18 21:00:26.996 INFO 8108 --- [ main] org.neo4j.driver.Driver : Direct driver instance 147735328 created for server address localhost:7687
2021-10-18 21:00:27.366 INFO 8108 --- [ main] com.trianz.datamesh.DatameshApplication : Started DatameshApplication in 21.184 seconds (JVM running for 28.361)
2021-10-18 21:01:20.393 WARN 8108 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=57s713ms652µs100ns).
2021-10-18 21:02:12.019 WARN 8108 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=57s378ms596µs700ns).
2021-10-18 21:02:24.298 INFO 8108 --- [ main] com.trianz.datamesh.DatameshApplication : Application Running
2021-10-18 21:02:46.579 INFO 8108 --- [ionShutdownHook] org.neo4j.driver.Driver : Closing driver instance 147735328
2021-10-18 21:02:46.862 INFO 8108 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-10-18 21:02:46.872 INFO 8108 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-10-18 21:02:46.884 INFO 8108 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.

这是我的 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.5.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.trianz.datamesh</groupId>
<artifactId>datamesh</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>datamesh</name>
<description>datamesh mvp 2 athena</description>
<properties>
<java.version>1.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-tomcat</artifactId>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.14</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>


<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.modelmapper/modelmapper -->
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>

<!--<dependency>-->
<!--<groupId>org.springframework.kafka</groupId>-->
<!--<artifactId>spring-kafka</artifactId>-->
<!--</dependency>-->

<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>2.7.0</version>
</dependency>

<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.8.0</version>
</dependency>



<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>


<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>




<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>


<dependency>
<groupId>com.amazon.redshift</groupId>
<artifactId>redshift-jdbc42</artifactId>
<version>2.1.0.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.neo4j.driver/neo4j-java-driver -->
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>4.3.2</version>
</dependency>


<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.7.20</version>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.586</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20201115</version>
</dependency>

</dependencies>



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

</project>

最佳答案

<强>1。去掉依赖之间的空格

<强>2。更新父版本"spring-boot-starter-parent2.5.5.

<强>3。从“spring-boot-starter-tomcat”中删除作用域

<?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.5.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.trianz.datamesh</groupId>
<artifactId>datamesh</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>datamesh</name>
<description>datamesh mvp 2 athena</description>
<properties>
<java.version>1.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-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.14</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.modelmapper/modelmapper -->
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.amazon.redshift</groupId>
<artifactId>redshift-jdbc42</artifactId>
<version>2.1.0.1</version>
</dependency>
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>4.3.2</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.7.20</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.586</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20201115</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

关于java - 为持久性单元 'default' 关闭 JPA Entity_Manage_Factory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69619425/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com