Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,
    Expert tip

    MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg

  2. ,

    Make sure you are using InnoDB storage engine and READ-COMMITTED transaction isolation level and increase the database server innodb_lock_wait_timeout variable to about 500.

Solutions on the web

via Hibernate JIRA by Isen, 1 year ago
org.hibernate.exception.GenericJDBCException: could not execute query; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
via Hibernate JIRA by Isen, 2 years ago
org.hibernate.exception.GenericJDBCException: could not execute query; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
via Stack Overflow by IsenGrim
, 2 years ago
org.hibernate.exception.GenericJDBCException: could not execute query; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
via Stack Overflow by Jay Shark
, 2 years ago
org.hibernate.exception.ConstraintViolationException: could not insert: [com.myapp.Department]; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.myapp.Department]
via Stack Overflow by user3767527
, 1 year ago
org.hibernate.exception.GenericJDBCException: could not load an entity: [com.mycomp.casa.persistence.model.CustomerAccountOpening#554]; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not load an entity: [com.mycomp.casa.persistence.model.CustomerAccountOpening#554]
via Stack Overflow by landoooo
, 2 years ago
org.hibernate.id.IdentifierGenerationException: null id generated for:class something.persistence.entity.message.MessageDesc; nested exception is javax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: null id generated for:class something.persistence.entity.message.MessageDesc
java.sql.SQLException: Invalid value for getInt() - 'Foo'	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)	at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2705)	at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2793)	at org.hibernate.type.EnumType$OrdinalEnumValueMapper.getValue(EnumType.java:372)	at org.hibernate.type.EnumType.nullSafeGet(EnumType.java:107)	at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:127)	at org.hibernate.type.AbstractType.hydrate(AbstractType.java:106)	at org.hibernate.type.ComponentType.hydrate(ComponentType.java:641)	at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:785)	at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:721)	at org.hibernate.loader.Loader.processResultSet(Loader.java:953)	at org.hibernate.loader.Loader.doQuery(Loader.java:921)	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355)	at org.hibernate.loader.Loader.doList(Loader.java:2554)	at org.hibernate.loader.Loader.doList(Loader.java:2540)	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370)	at org.hibernate.loader.Loader.list(Loader.java:2365)	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:497)	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387)	at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:236)	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1300)	at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)	at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573)	at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:495)	at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getSingleResult(CriteriaQueryTypeQueryAdapter.java:71)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.lang.reflect.Method.invoke(Method.java:498)	at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:364)	at com.sun.proxy.$Proxy50.getSingleResult(Unknown Source)	at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:206)	at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:78)	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:100)	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:91)	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:462)	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:440)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:131)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)	at com.sun.proxy.$Proxy49.getByUserIdAndAppType(Unknown Source)	at com.treeboxsolutions.services.onCredentialService.databaseProviders.dataAccessLayer.repositories.CurrentCredentialRepositoryTest.saveShouldCorrectlySave(CurrentCredentialRepositoryTest.java:49)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.lang.reflect.Method.invoke(Method.java:498)	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254)	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.lang.reflect.Method.invoke(Method.java:498)	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)