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. ,
    via stackoverflow.com by Unknown author

    Upgrade the database driver to the latest and check.

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.3-1101-jdbc41</version>
    </dependency>
    

    Replace version with the latest driver version.

  2. ,
    Expert tip

    Try downgrading PostgresSQL server to 9.5 or update your PostgresSQL driver to 9.4-1211 with the following command: <postgresql.version>9.4.1211</postgresql.version>

Solutions on the web

via GitHub by vwilliam
, 1 year ago
org.hibernate.exception.ConstraintViolationException: could not execute statement
via Stack Overflow by erisawesome
, 1 year ago
org.hibernate.exception.SQLGrammarException: could not prepare statement
via Stack Overflow by erisawesome
, 1 year ago
org.hibernate.exception.SQLGrammarException: could not prepare statement
via Stack Overflow by Steve
, 8 months ago
org.hibernate.exception.ConstraintViolationException: could not execute statement
via GitHub by kjlorenzo
, 1 year ago
org.hibernate.exception.GenericJDBCException: could not extract ResultSet
org.postgresql.util.PSQLException: ERROR: update or delete on table "users" violates foreign key constraint "fkey_user_id" on table "sessions"
  Detail: Key (id)=(1) is still referenced from table "sessions".	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:133)	at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)	at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)	at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3246)	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3483)	at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:99)	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:560)	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:434)	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)	at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1396)	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:472)	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3132)	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2369)	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467)	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:147)	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:221)	at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)	at org.friends.app.dao.impl.UserDaoImpl.delete(UserDaoImpl.java:77)	at org.friends.app.dao.impl.UserDaoImpl$$FastClassBySpringCGLIB$$74eef025.invoke()	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)	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.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)	at org.friends.app.dao.impl.UserDaoImpl$$EnhancerBySpringCGLIB$$50b9eb90.delete()	at org.friends.app.service.impl.UserServiceBean.delete(UserServiceBean.java:239)	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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)	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.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)	at com.sun.proxy.$Proxy29.delete(Unknown Source)	at org.friends.app.view.route.UnregisterRoute.doHandle(UnregisterRoute.java:29)	at org.friends.app.view.route.AuthenticatedRoute.handle(AuthenticatedRoute.java:26)	at spark.TemplateViewRouteImpl$1.handle(TemplateViewRouteImpl.java:66)	at spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:162)	at spark.servlet.SparkFilter.doFilter(SparkFilter.java:122)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)	at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:827)	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)	at java.lang.Thread.run(Thread.java:745)