org.springframework.data.redis.RedisSystemException: Unknown jedis exception; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement

Spring JIRA | Andrey Borisov | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    I have 2 beans defined in Application Context: {code:java} @Bean public HibernateExceptionTranslator hibernateExceptionTranslator() { return new HibernateExceptionTranslator(); } @Bean public RedisConnectionFactory redisConnectionFactory() { Properties devProps = localDevProps(); JedisConnectionFactory cf = new JedisConnectionFactory(); return cf; } {code} Both implement {{PersistenceExceptionTranslator}} and both {{TransactionalRepositoryFactoryBeanSupport}} and {{PersistenceExceptionTranslationRepositoryProxyPostProcessor}} creates default {{PersistenceExceptionTranslationInterceptor}} which auto-discover all implementation of this interface. Finally at runtime I get {{JedisException}} when a JPA/Hibernate Exception expected. {noformat} org.springframework.data.redis.RedisSystemException: Unknown jedis exception; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:57) at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:36) at org.springframework.data.redis.connection.jedis.JedisConverters.toDataAccessException(JedisConverters.java:138) at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.translateExceptionIfPossible(JedisConnectionFactory.java:151) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) {noformat}

    Spring JIRA | 3 years ago | Andrey Borisov
    org.springframework.data.redis.RedisSystemException: Unknown jedis exception; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
  2. 0

    I have 2 beans defined in Application Context: {code:java} @Bean public HibernateExceptionTranslator hibernateExceptionTranslator() { return new HibernateExceptionTranslator(); } @Bean public RedisConnectionFactory redisConnectionFactory() { Properties devProps = localDevProps(); JedisConnectionFactory cf = new JedisConnectionFactory(); return cf; } {code} Both implement {{PersistenceExceptionTranslator}} and both {{TransactionalRepositoryFactoryBeanSupport}} and {{PersistenceExceptionTranslationRepositoryProxyPostProcessor}} creates default {{PersistenceExceptionTranslationInterceptor}} which auto-discover all implementation of this interface. Finally at runtime I get {{JedisException}} when a JPA/Hibernate Exception expected. {noformat} org.springframework.data.redis.RedisSystemException: Unknown jedis exception; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:57) at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:36) at org.springframework.data.redis.connection.jedis.JedisConverters.toDataAccessException(JedisConverters.java:138) at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.translateExceptionIfPossible(JedisConnectionFactory.java:151) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) {noformat}

    Spring JIRA | 3 years ago | Andrey Borisov
    org.springframework.data.redis.RedisSystemException: Unknown jedis exception; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
  3. 0

    Spring: JPA not working within @PreDestroy call stacks

    Stack Overflow | 1 year ago | Mike Fairhurst
    org.springframework.data.redis.RedisSystemException: Unknown jedis exception; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.data.redis.RedisSystemException

      Unknown jedis exception; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement

      at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert()
    2. Spring Data Redis
      JedisConnectionFactory.translateExceptionIfPossible
      1. org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:57)
      2. org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:36)
      3. org.springframework.data.redis.connection.jedis.JedisConverters.toDataAccessException(JedisConverters.java:138)
      4. org.springframework.data.redis.connection.jedis.JedisConnectionFactory.translateExceptionIfPossible(JedisConnectionFactory.java:151)
      4 frames
    3. Spring Tx
      PersistenceExceptionTranslationInterceptor.invoke
      1. org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)
      2. org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
      3. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163)
      3 frames
    4. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      1 frame