java - 在收到对等方的 close_notify 之前关闭入站

标签 java mysql spring hibernate

我的 PC 上有一个正常工作的项目(Spring + Mysql + Hibernate),但后来我用相同的设置在我的笔记本电脑上复制了这个项目,它不起作用并且抛出这个异常 ->

** BEGIN NESTED EXCEPTION ** 

javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify

STACKTRACE:

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:129)
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:255)
    at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:645)
    at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:624)
    at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:2249)
    at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4232)
    at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1472)
    at com.zaxxer.hikari.pool.PoolBase.quietlyCloseConnection(PoolBase.java:132)
    at com.zaxxer.hikari.pool.HikariPool.lambda$closeConnection$1(HikariPool.java:434)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)


** END NESTED EXCEPTION **

还有这个 ->

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister

这是我连接到数据库的 application.properties

# ===============================
# = DATA SOURCE
# ===============================
# Set here configurations for the database connection
spring.datasource.url=jdbc:mysql://localhost:3306/shop_v3
spring.datasource.username=root
spring.datasource.password=12345
#spring.datasource.password=YOUR_DB_PASSWORD
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle=true
spring.datasource.validationQuery=SELECT 1
# ===============================
# = JPA / HIBERNATE
# ===============================
# Show or not log for each sql query
spring.jpa.show-sql=true

spring.jpa.hibernate.ddl-auto=create-drop
# Hibernate ddl auto (create, create-drop, update): with "create-drop" the database
# schema will be automatically created afresh for every start of application
# Naming strategy
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl
spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

可能是因为我使用了不同版本的JDK。在我的 PC 上安装 JDK10,在笔记本电脑上安装 JDK11?

我不明白为什么会出现这个错误,因为正如我上面所说,这段代码在我的 PС 上运行良好。

最佳答案

我和你有同样的错误,javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify,我使用connector/J 8.0,得到这个错误,所以我尝试更改为 connector/J 5,但出现另一个错误,但该错误告诉我将 ssl connector 设置为 false,我这样做了,问题解决了。 db_url = "jdbc:mysql://localhost:3306/stu?useSSL=false", stu 是我的本地主机数据库

希望对您有所帮助!

关于java - 在收到对等方的 close_notify 之前关闭入站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52945768/

相关文章:

java - 对象属性共享同一个实例

MySQL:如何引用 SELECT 查询中已经提到的项目

php - woocommerce给50000种产品一个新的类别

mysql - 按某种顺序排序,然后随机?

spring - 如何将 Classifier 与 ClassifierCompositeItemWriter 一起使用?

java - shutdown 和 awaitTermination 哪个第一次调用有什么区别?

java - MVC 和 Java 网页设计 : Model structure

java - 将json数组序列化为java对象

java - 如何在使用 @ToString 注释或通过创建新注释记录时屏蔽值

xml - pom文件中缺少包装标签