Closing inbound before receiving peer's close_notify

Viewed 8218

I have a normally working project(Spring + Mysql + Hibernate) on my PC, but then I copy this project with the same settings in my laptop it doesn't work and throw this exception ->

** 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 **

And also throw this ->

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

This is my application.properties where i connect to my DB

# ===============================
# = 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

Maybe because I use different versions of JDK. On my PC installed JDK10, on laptop JDK11?

I can't understand why this error comes out, because as I said above this code works fine on my PС.

2 Answers

I got the same error with you,javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify,I use connectotor/J 8.0,got this error,so i tried to change to connectotor/J 5, I got another error, but the error tell me to set ssl connector to false,I do that, the problem solved. db_url = "jdbc:mysql://localhost:3306/stu?useSSL=false", the stu is my localhost databse

Hopefully it can help you!

I solved id! I incorrectly imported my project into idea

Related