org.obiba.magma.MagmaRuntimeException: org.hibernate.exception.ConstraintViolationException: could not execute statement

JIRA | Ramin Haeri Azad | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I started a new project: - deleted git views (to be certain) - deleted my config files - deleted my DBs (opal_data and opal_key in 'mysql') - created new config files - started OPAL server - setup the identifiers DB - setup the default storage DB - created a new project (always using the same name, think is irrelevant) - selected the Tables section Got the following exception: {code} 2013-10-18 17:31:29:478 INFO Loading configuration from input stream [OServerConfigurationLoaderXml] 2013-10-18 17:31:29:715 INFO Profiler is recording metrics with configuration: 0,0,0 [OJVMProfiler] 2013-10-18 17:31:29:716 INFO OrientDB Server v1.5.1 is starting up... [OServer] 2013-10-18 17:31:29:748 INFO Listening binary connections on 0.0.0.0:2424 (protocol v.17) [OServerNetworkListener] 2013-10-18 17:31:29:748 INFO Listening http connections on 0.0.0.0:2480 (protocol v.10) [OServerNetworkListener] 2013-10-18 17:31:29:758 INFO Mail plugin installed and active. Loaded 1 profile(s): [default] [OMailPlugin] 2013-10-18 17:31:29:760 INFO OrientDB Server v1.5.1 is active. [OServer]Upgrading Opal. Upgrade successful. Starting Opal. Opal Server successfully started. Opal is attached to this console. Press ctrl-c to stop. 2013-10-18 17:36:05,628 - ERROR - dbc.spi.SqlExceptionHelper - Duplicate entry 'opal-keys' for key 'UK_c270jcqlmvthpcasvusahxb7h' 2013-10-18 17:36:05,629 - ERROR - der.RuntimeExceptionMapper - Unhandled exception org.obiba.magma.MagmaRuntimeException: org.hibernate.exception.ConstraintViolationException: could not execute statement at org.obiba.magma.support.Initialisables.initialise(Initialisables.java:18) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getDatasource(DefaultIdentifiersTableService.java:120) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getValueTable(DefaultIdentifiersTableService.java:61) at org.obiba.opal.web.FunctionalUnitsResource.getEntitiesTable(FunctionalUnitsResource.java:215) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:65) at org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:54) at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329) at org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter$1.doInTransactionWithoutResult(OpalJettyServer.java:325) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) at org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter.doFilterInternal(OpalJettyServer.java:321) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.obiba.opal.server.httpd.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:82) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.obiba.opal.server.httpd.OpalJettyServer$OpalVersionFilter.doFilterInternal(OpalJettyServer.java:305) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:363) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:722) {code}

    JIRA | 3 years ago | Ramin Haeri Azad
    org.obiba.magma.MagmaRuntimeException: org.hibernate.exception.ConstraintViolationException: could not execute statement
  2. 0

    I started a new project: - deleted git views (to be certain) - deleted my config files - deleted my DBs (opal_data and opal_key in 'mysql') - created new config files - started OPAL server - setup the identifiers DB - setup the default storage DB - created a new project (always using the same name, think is irrelevant) - selected the Tables section Got the following exception: {code} 2013-10-18 17:31:29:478 INFO Loading configuration from input stream [OServerConfigurationLoaderXml] 2013-10-18 17:31:29:715 INFO Profiler is recording metrics with configuration: 0,0,0 [OJVMProfiler] 2013-10-18 17:31:29:716 INFO OrientDB Server v1.5.1 is starting up... [OServer] 2013-10-18 17:31:29:748 INFO Listening binary connections on 0.0.0.0:2424 (protocol v.17) [OServerNetworkListener] 2013-10-18 17:31:29:748 INFO Listening http connections on 0.0.0.0:2480 (protocol v.10) [OServerNetworkListener] 2013-10-18 17:31:29:758 INFO Mail plugin installed and active. Loaded 1 profile(s): [default] [OMailPlugin] 2013-10-18 17:31:29:760 INFO OrientDB Server v1.5.1 is active. [OServer]Upgrading Opal. Upgrade successful. Starting Opal. Opal Server successfully started. Opal is attached to this console. Press ctrl-c to stop. 2013-10-18 17:36:05,628 - ERROR - dbc.spi.SqlExceptionHelper - Duplicate entry 'opal-keys' for key 'UK_c270jcqlmvthpcasvusahxb7h' 2013-10-18 17:36:05,629 - ERROR - der.RuntimeExceptionMapper - Unhandled exception org.obiba.magma.MagmaRuntimeException: org.hibernate.exception.ConstraintViolationException: could not execute statement at org.obiba.magma.support.Initialisables.initialise(Initialisables.java:18) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getDatasource(DefaultIdentifiersTableService.java:120) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getValueTable(DefaultIdentifiersTableService.java:61) at org.obiba.opal.web.FunctionalUnitsResource.getEntitiesTable(FunctionalUnitsResource.java:215) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:65) at org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:54) at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329) at org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter$1.doInTransactionWithoutResult(OpalJettyServer.java:325) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) at org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter.doFilterInternal(OpalJettyServer.java:321) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.obiba.opal.server.httpd.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:82) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.obiba.opal.server.httpd.OpalJettyServer$OpalVersionFilter.doFilterInternal(OpalJettyServer.java:305) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:363) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:722) {code}

    JIRA | 3 years ago | Ramin Haeri Azad
    org.obiba.magma.MagmaRuntimeException: org.hibernate.exception.ConstraintViolationException: could not execute statement

    Root Cause Analysis

    1. org.obiba.magma.MagmaRuntimeException

      org.hibernate.exception.ConstraintViolationException: could not execute statement

      at org.obiba.magma.support.Initialisables.initialise()
    2. org.obiba.magma
      Initialisables.initialise
      1. org.obiba.magma.support.Initialisables.initialise(Initialisables.java:18)
      1 frame
    3. org.obiba.opal
      FunctionalUnitsResource.getEntitiesTable
      1. org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getDatasource(DefaultIdentifiersTableService.java:120)
      2. org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getValueTable(DefaultIdentifiersTableService.java:61)
      3. org.obiba.opal.web.FunctionalUnitsResource.getEntitiesTable(FunctionalUnitsResource.java:215)
      3 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    5. RESTEasy JAX-RS Implementation
      HttpServletDispatcher.service
      1. org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:65)
      2. org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:54)
      3. org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91)
      4. org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
      5. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
      6. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
      7. org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
      8. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
      9. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
      9 frames
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      1 frame
    7. Jetty
      ServletHandler$CachedChain.doFilter
      1. org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
      2. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329)
      2 frames
    8. org.obiba.opal
      OpalJettyServer$TransactionFilter$1.doInTransactionWithoutResult
      1. org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter$1.doInTransactionWithoutResult(OpalJettyServer.java:325)
      1 frame
    9. Spring Tx
      TransactionTemplate.execute
      1. org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
      2. org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
      2 frames
    10. org.obiba.opal
      OpalJettyServer$TransactionFilter.doFilterInternal
      1. org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter.doFilterInternal(OpalJettyServer.java:321)
      1 frame
    11. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      1 frame
    12. Jetty
      ServletHandler$CachedChain.doFilter
      1. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
      1 frame
    13. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
      2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      2 frames
    14. Jetty
      ServletHandler$CachedChain.doFilter
      1. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
      1 frame
    15. org.obiba.opal
      AuthenticationFilter.doFilterInternal
      1. org.obiba.opal.server.httpd.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:82)
      1 frame
    16. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      1 frame
    17. Jetty
      ServletHandler$CachedChain.doFilter
      1. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
      1 frame
    18. org.obiba.opal
      OpalJettyServer$OpalVersionFilter.doFilterInternal
      1. org.obiba.opal.server.httpd.OpalJettyServer$OpalVersionFilter.doFilterInternal(OpalJettyServer.java:305)
      1 frame
    19. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      1 frame
    20. Jetty
      AsyncHttpConnection.handle
      1. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
      2. org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
      3. org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
      4. org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
      5. org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
      6. org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
      7. org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
      8. org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
      9. org.eclipse.jetty.server.Server.handle(Server.java:363)
      10. org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
      11. org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
      12. org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
      13. org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
      14. org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      15. org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
      15 frames
    21. GWT dev
      SelectChannelEndPoint$1.run
      1. org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
      2. org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
      2 frames
    22. Jetty
      QueuedThreadPool$3.run
      1. org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
      2. org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
      2 frames
    23. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:722)
      1 frame