org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection

tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost

    Stack Overflow | 8 months ago | Othman Chahboune
    org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
  2. 0

    idea使用mybatis时访问数据库超时 - 开源中国社区

    oschina.net | 5 days ago
    com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

    Root Cause Analysis

    1. java.io.EOFException

      Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

      at com.mysql.cj.core.io.FullReadInputStream.readFully()
    2. com.mysql.cj
      NonRegisteringDriver.connect
      1. com.mysql.cj.core.io.FullReadInputStream.readFully(FullReadInputStream.java:61)
      2. com.mysql.cj.mysqla.io.MysqlaProtocol.readPacket(MysqlaProtocol.java:412)
      3. com.mysql.cj.mysqla.io.MysqlaProtocol.readServerCapabilities(MysqlaProtocol.java:371)
      4. com.mysql.cj.mysqla.io.MysqlaProtocol.beforeHandshake(MysqlaProtocol.java:334)
      5. com.mysql.cj.mysqla.io.MysqlaProtocol.connect(MysqlaProtocol.java:1710)
      6. com.mysql.cj.mysqla.MysqlaSession.connect(MysqlaSession.java:149)
      7. com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1803)
      8. com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1673)
      9. com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:656)
      10. com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:349)
      11. com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:221)
      11 frames
    3. Java RT
      DriverManager.getConnection
      1. java.sql.DriverManager.getConnection(Unknown Source)
      2. java.sql.DriverManager.getConnection(Unknown Source)
      2 frames
    4. Spring Framework
      AbstractDriverBasedDataSource.getConnection
      1. org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153)
      2. org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144)
      3. org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:155)
      4. org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:120)
      4 frames
    5. org.hibernate.engine
      DatasourceConnectionProviderImpl.getConnection
      1. org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
      1 frame
    6. Hibernate
      AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection
      1. org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:382)
      1 frame
    7. org.hibernate.resource
      JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin
      1. org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:87)
      2. org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:112)
      3. org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getConnectionForTransactionManagement(LogicalConnectionManagedImpl.java:230)
      4. org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:237)
      5. org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTransactionCoordinatorImpl.java:213)
      5 frames
    8. Hibernate
      SessionImpl.beginTransaction
      1. org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:52)
      2. org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1439)
      2 frames
    9. org.hibernate.jpa
      TransactionImpl.begin
      1. org.hibernate.jpa.internal.TransactionImpl.begin(TransactionImpl.java:45)
      1 frame
    10. Spring ORM
      JpaTransactionManager.doBegin
      1. org.springframework.orm.jpa.DefaultJpaDialect.beginTransaction(DefaultJpaDialect.java:67)
      2. org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:380)
      2 frames
    11. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:427)
      3. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276)
      4. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      4 frames
    12. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
      2 frames
    13. com.sun.proxy
      $Proxy25.addClient
      1. com.sun.proxy.$Proxy25.addClient(Unknown Source)
      1 frame
    14. test
      Test.main
      1. test.Test.main(Test.java:12)
      1 frame