javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement

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

    Impossible to execute Save action: org.hibernate.exception.SQLGrammarException: could not execute statement

    openxava | 10 months ago | tianschoeman
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
  2. 0

    Mensaje de error al crear organizaciones

    openxava | 2 weeks ago | jegomez
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
  3. 0

    How to resolve "Caused by: org.postgresql.util.PSQLException: ERROR: relation "employee" does not exist Position: 13" error?

    Stack Overflow | 10 months ago | TechGuy
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    We have done an upgrade from PuppetDB 3.2.4 to PuppetDB 4.1.2 (using apt.puppetlabs.com packages). While the upgrade basically seems to be fine and it looks like that all PuppetDB-related stuff is working too, we see reoccurring duplicate-key-value-violates-unique-constraint in the puppetdb.log: {code:java} 2016-07-21 07:56:07,017 ERROR [p.p.mq-listener] [bc81b75b-9dad-432d-ae6c-a15d4f3e9305] [store report] Retrying after attempt 11 for somenode.example.com, due to: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_hash_expr_idx" Detail: Key (encode(hash, 'hex'::text))=(66929dd40d99b8addcb9f42e02f51675cd6a2357) already exists. org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_hash_expr_idx" Detail: Key (encode(hash, 'hex'::text))=(66929dd40d99b8addcb9f42e02f51675cd6a2357) already exists. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284) ~[puppetdb.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003) ~[puppetdb.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200) ~[puppetdb.jar:na] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424) ~[puppetdb.jar:na] at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161) ~[puppetdb.jar:na] at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:133) ~[puppetdb.jar:na] at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[puppetdb.jar:na] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[puppetdb.jar:na] at clojure.java.jdbc$db_do_prepared_return_keys$exec_and_return_keys__20693.invoke(jdbc.clj:727) ~[na:na] at clojure.java.jdbc$db_do_prepared_return_keys.invokeStatic(jdbc.clj:742) ~[na:na] at clojure.java.jdbc$db_do_prepared_return_keys.invoke(jdbc.clj:714) ~[na:na] at clojure.java.jdbc$multi_insert_helper$fn__20747.invoke(jdbc.clj:937) ~[na:na] at clojure.core$map$fn__4785.invoke(core.clj:2646) ~[puppetdb.jar:na] at clojure.lang.LazySeq.sval(LazySeq.java:40) ~[puppetdb.jar:na] at clojure.lang.LazySeq.seq(LazySeq.java:49) ~[puppetdb.jar:na] at clojure.lang.RT.seq(RT.java:521) ~[puppetdb.jar:na] at clojure.core$seq__4357.invokeStatic(core.clj:137) ~[puppetdb.jar:na] at clojure.core$dorun.invokeStatic(core.clj:3024) ~[puppetdb.jar:na] at clojure.core$doall.invokeStatic(core.clj:3039) ~[puppetdb.jar:na] at clojure.core$doall.invoke(core.clj:3039) ~[puppetdb.jar:na] at clojure.java.jdbc$multi_insert_helper.invokeStatic(jdbc.clj:936) ~[na:na] at clojure.java.jdbc$multi_insert_helper.invoke(jdbc.clj:931) ~[na:na] at clojure.java.jdbc$insert_helper$fn__20750.invoke(jdbc.clj:947) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:620) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:425) ~[puppetdb.jar:na] at clojure.java.jdbc$insert_helper.invokeStatic(jdbc.clj:947) ~[na:na] at clojure.java.jdbc$insert_helper.invoke(jdbc.clj:940) ~[na:na] at clojure.java.jdbc$insert_BANG_.invokeStatic(jdbc.clj:1037) ~[na:na] at clojure.java.jdbc$insert_BANG_.doInvoke(jdbc.clj:1024) ~[na:na] at clojure.lang.RestFn.applyTo(RestFn.java:142) ~[puppetdb.jar:na] at clojure.core$apply.invokeStatic(core.clj:650) ~[puppetdb.jar:na] at clojure.core$apply.invoke(core.clj:641) ~[puppetdb.jar:na] at puppetlabs.puppetdb.jdbc$insert_BANG_.invokeStatic(jdbc.clj:64) ~[na:na] at puppetlabs.puppetdb.jdbc$insert_BANG_.doInvoke(jdbc.clj:57) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:423) ~[puppetdb.jar:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206$fn__35207$fn__35208$fn__35210.invoke(storage.clj:1260) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:620) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:425) ~[puppetdb.jar:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206$fn__35207$fn__35208.invoke(storage.clj:1236) ~[na:na] at puppetlabs.puppetdb.scf.storage.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source) ~[na:na] at com.codahale.metrics.Timer.time(Timer.java:101) ~[puppetdb.jar:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206$fn__35207.invoke(storage.clj:1229) ~[na:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206.invoke(storage.clj:1221) ~[na:na] at puppetlabs.puppetdb.scf.storage$eval35437$add_report_BANG___35442$fn__35443.invoke(storage.clj:1400) ~[na:na] at puppetlabs.puppetdb.scf.storage$eval35437$add_report_BANG___35442.invoke(storage.clj:1396) ~[na:na] at puppetlabs.puppetdb.command$store_report_STAR_$fn__40763.invoke(command.clj:331) ~[na:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn__21230$fn__21231.invoke(jdbc.clj:306) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:595) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:464) ~[puppetdb.jar:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn__21230.invoke(jdbc.clj:305) ~[na:na] at puppetlabs.puppetdb.jdbc$eval21204$retry_sql_STAR___21209$fn__21210$fn__21211.invoke(jdbc.clj:283) ~[na:na] at puppetlabs.puppetdb.jdbc$eval21204$retry_sql_STAR___21209$fn__21210.invoke(jdbc.clj:282) ~[na:na] at puppetlabs.puppetdb.jdbc$eval21204$retry_sql_STAR___21209.invoke(jdbc.clj:273) ~[na:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn.invokeStatic(jdbc.clj:303) ~[na:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn.invoke(jdbc.clj:298) ~[na:na] at puppetlabs.puppetdb.command$store_report_STAR_.invokeStatic(command.clj:329) ~[na:na] at puppetlabs.puppetdb.command$store_report_STAR_.invoke(command.clj:324) ~[na:na] at puppetlabs.puppetdb.command$store_report.invokeStatic(command.clj:348) ~[na:na] at puppetlabs.puppetdb.command$store_report.invoke(command.clj:336) ~[na:na] at puppetlabs.puppetdb.command$process_command_BANG_.invokeStatic(command.clj:370) ~[na:na] at puppetlabs.puppetdb.command$process_command_BANG_.invoke(command.clj:363) ~[na:na] at puppetlabs.puppetdb.command$process_command_and_respond_BANG_.invokeStatic(command.clj:415) ~[na:na] at puppetlabs.puppetdb.command$process_command_and_respond_BANG_.invoke(command.clj:413) ~[na:na] at puppetlabs.puppetdb.command$reify__40907$service_fnk__11356__auto___positional$reify__40918$fn__40921.invoke(command.clj:451) ~[na:na] at puppetlabs.puppetdb.mq_listener$reify__41157$service_fnk__11356__auto___positional$reify__41167.process_message(mq_listener.clj:412) ~[na:na] at puppetlabs.puppetdb.mq_listener$reify__41157$service_fnk__11356__auto___positional$reify__41167$process_msg__41168.invoke(mq_listener.clj:380) ~[na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_discard$fn__40983$fn__40985.invoke(mq_listener.clj:228) ~[na:na] at puppetlabs.puppetdb.mq_listener.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source) ~[na:na] at com.codahale.metrics.Timer.time(Timer.java:101) ~[puppetdb.jar:na] at puppetlabs.puppetdb.mq_listener$wrap_with_discard$fn__40983.invoke(mq_listener.clj:227) ~[na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_exception_handling$fn__40971$fn__40973.invoke(mq_listener.clj:182) ~[na:na] at puppetlabs.puppetdb.mq_listener.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source) ~[na:na] at com.codahale.metrics.Timer.time(Timer.java:101) ~[puppetdb.jar:na] at puppetlabs.puppetdb.mq_listener$wrap_with_exception_handling$fn__40971.invoke(mq_listener.clj:181) ~[na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_command_parser$fn__40979.invoke(mq_listener.clj:204) [na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_meter$fn__40963.invoke(mq_listener.clj:142) [na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_thread_name$fn__40990.invoke(mq_listener.clj:243) [na:na] at puppetlabs.puppetdb.mq_listener$start_receiver$reify__41150.onMessage(mq_listener.clj:360) [na:na] at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1401) [puppetdb.jar:na] at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) [puppetdb.jar:na] at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) [puppetdb.jar:na] at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133) [puppetdb.jar:na] at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) [puppetdb.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_101] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_101] {code} Despite this message, reports seems to be stored fine in PuppetDB - at least what we can see with puppetboard. I'm not sure if this is related, but also another message is displayed since the ugprade to 4.1.2 and appears ahead the "store report" entries: {code:java} 2016-07-21 07:56:07,495 WARN [p.p.h.command] Unable to stream command posted without parameters (loading into RAM) 2016-07-21 07:56:07,527 INFO [p.p.command] [6bd95e5b-7d5c-45c2-a238-65f1812f7a3a] [store report] puppet v3.8.5 - somenode1.example.com 2016-07-21 07:56:07,880 WARN [p.p.h.command] Unable to stream command posted without parameters (loading into RAM) 2016-07-21 07:56:07,912 INFO [p.p.command] [f839e90d-6ece-44e2-9abf-1fdb4eeb7e89] [store report] puppet v3.8.5 - somenode2.example.com {code}

    JIRA | 9 months ago | Andreas Unterkircher
    org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_hash_expr_idx" Detail: Key (encode(hash, 'hex'::text))=(66929dd40d99b8addcb9f42e02f51675cd6a2357) already exists.
  6. 0

    GitHub comment 121#244860184

    GitHub | 8 months ago | vwilliam
    javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.postgresql.util.PSQLException

    ERROR: column "commercialdocument_oid" specified more than once Position: 65

    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse()
  2. PostgreSQL JDBC Driver
    QueryExecutorImpl.execute
    1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
    2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
    3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
    3 frames
  3. org.postgresql.jdbc
    PgPreparedStatement.executeUpdate
    1. org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
    2. org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
    3. org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:133)
    3 frames
  4. org.apache.tomcat
    DelegatingPreparedStatement.executeUpdate
    1. org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    2. org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    2 frames
  5. Hibernate
    SessionImpl.flush
    1. org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
    2. org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:62)
    3. org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1311)
    4. org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:67)
    5. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:465)
    6. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:351)
    7. org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)
    8. org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    9. org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1258)
    9 frames
  6. org.hibernate.jpa
    AbstractEntityManagerImpl.flush
    1. org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1335)
    1 frame
  7. org.openxava.jpa
    EntityManagerDecorator.flush
    1. org.openxava.jpa.impl.EntityManagerDecorator.flush(EntityManagerDecorator.java:157)
    1 frame
  8. org.openxava.model
    MapFacade.create
    1. org.openxava.model.impl.JPAPersistenceProvider.flush(JPAPersistenceProvider.java:97)
    2. org.openxava.model.impl.MapFacadeBean.commitTransaction(MapFacadeBean.java:76)
    3. org.openxava.model.impl.MapFacadeBean.create(MapFacadeBean.java:46)
    4. org.openxava.model.MapFacade.create(MapFacade.java:112)
    4 frames
  9. org.openxava.actions
    SaveAction.execute
    1. org.openxava.actions.SaveAction.execute(SaveAction.java:27)
    1 frame
  10. org.openxava.controller
    ModuleManager.execute
    1. org.openxava.controller.ModuleManager.executeAction(ModuleManager.java:513)
    2. org.openxava.controller.ModuleManager.executeAction(ModuleManager.java:421)
    3. org.openxava.controller.ModuleManager.execute(ModuleManager.java:378)
    3 frames
  11. org.apache.jsp
    execute_jsp._jspService
    1. org.apache.jsp.xava.execute_jsp._jspService(execute_jsp.java:196)
    1 frame
  12. GWT dev
    HttpJspBase.service
    1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    1 frame
  13. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    1 frame
  14. GWT dev
    JspServlet.service
    1. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    2. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    3. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    3 frames
  15. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    1 frame
  16. Glassfish Core
    ApplicationDispatcher.include
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    3. org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    4. org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
    5. org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
    5 frames
  17. org.openxava.web
    Module.request
    1. org.openxava.web.servlets.Servlets.getURIAsStream(Servlets.java:66)
    2. org.openxava.web.dwr.Module.getURIAsStream(Module.java:202)
    3. org.openxava.web.dwr.Module.request(Module.java:61)
    3 frames
  18. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames
  19. Direct Web Remoting
    DwrServlet.doPost
    1. org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
    2. org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
    3. org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
    4. org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
    5. org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
    6. org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
    7. org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
    7 frames
  20. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    2. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    2 frames
  21. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    2 frames
  22. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    1 frame
  23. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
    10 frames
  24. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
    3 frames
  25. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    3. java.lang.Thread.run(Thread.java:745)
    3 frames