org.hibernate.exception.ConstraintViolationException: could not insert: [org.obiba.magma.datasource.hibernate.domain.ValueTableState]

JIRA | Yannick Marcon | 3 years ago
  1. 0

    Hibernate datasource should not allow creating a new table with same name. {code} 2013-09-19 08:32:51,381 - ERROR - util.JDBCExceptionReporter - Duplicate entry '1-keys' for key 'datasource_id' 2013-09-19 08:32:51,387 - ERROR - der.RuntimeExceptionMapper - Unhandled exception org.hibernate.exception.ConstraintViolationException: could not insert: [org.obiba.magma.datasource.hibernate.domain.ValueTableState] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2836) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:705) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:693) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:689) at org.obiba.magma.datasource.hibernate.HibernateDatasource.createWriter(HibernateDatasource.java:92) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService$2.doInTransactionWithoutResult(DefaultIdentifiersTableService.java:155) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getDatasource(DefaultIdentifiersTableService.java:148) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getValueTable(DefaultIdentifiersTableService.java:77) at org.obiba.opal.web.FunctionalUnitsResource.getEntitiesTable(FunctionalUnitsResource.java:224) 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:606) 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:296) 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:292) 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:276) 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:724) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1-keys' for key 'datasource_id' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2818) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2157) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2460) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2377) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2361) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57) ... 72 more {code}

    JIRA | 3 years ago | Yannick Marcon
    org.hibernate.exception.ConstraintViolationException: could not insert: [org.obiba.magma.datasource.hibernate.domain.ValueTableState]
  2. 0

    Hibernate datasource should not allow creating a new table with same name. {code} 2013-09-19 08:32:51,381 - ERROR - util.JDBCExceptionReporter - Duplicate entry '1-keys' for key 'datasource_id' 2013-09-19 08:32:51,387 - ERROR - der.RuntimeExceptionMapper - Unhandled exception org.hibernate.exception.ConstraintViolationException: could not insert: [org.obiba.magma.datasource.hibernate.domain.ValueTableState] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2836) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:705) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:693) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:689) at org.obiba.magma.datasource.hibernate.HibernateDatasource.createWriter(HibernateDatasource.java:92) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService$2.doInTransactionWithoutResult(DefaultIdentifiersTableService.java:155) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getDatasource(DefaultIdentifiersTableService.java:148) at org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getValueTable(DefaultIdentifiersTableService.java:77) at org.obiba.opal.web.FunctionalUnitsResource.getEntitiesTable(FunctionalUnitsResource.java:224) 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:606) 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:296) 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:292) 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:276) 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:724) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1-keys' for key 'datasource_id' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2818) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2157) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2460) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2377) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2361) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57) ... 72 more {code}

    JIRA | 3 years ago | Yannick Marcon
    org.hibernate.exception.ConstraintViolationException: could not insert: [org.obiba.magma.datasource.hibernate.domain.ValueTableState]
  3. 0

    2010.04.01 17:15:45 WARN o.h.u.JDBCExceptionReporter SQL Error: 1048, SQLState: 23000 2010.04.01 17:15:45 ERROR o.h.u.JDBCExceptionReporter Column 'rules_category_id' cannot be null 2010.04.01 17:15:45 INFO org.sonar.INFO Load rules done: 2746 ms 2010.04.01 17:15:46 ERROR org.mortbay.log Failed startup of context org.mortbay.jetty.webapp.WebAppContext@13e5454{/,file:/D:/Data/sonar-2.0.1/war/sonar-server} org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.server.startup.RuleLoader.start()', instance 'org.sonar.server.startup.RuleLoader@1202f4d, org.hibernate.exception.ConstraintViolationException: could not insert: [org.sonar.api.rules.Rule] at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77) [na:na] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:132) [na:na] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115) [na:na] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) [na:na] at org.picocontainer.injectors.AbstractInjector.start(AbstractInjector.java:133) [na:na] at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:170) [na:na] at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) [na:na] at org.picocontainer.behaviors.Stored.start(Stored.java:110) [na:na] at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:995) [na:na] at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:988) [na:na] at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:745) [na:na] at org.sonar.server.Server.executeStartupTasks(Server.java:117) [na:na] at org.sonar.server.Server.start(Server.java:88) [na:na] at org.sonar.server.web.ApplicationListener.contextInitialized(ApplicationListener.java:45) [na:na] at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) [jetty-6.1.17.jar:6.1.17] at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) [jetty-6.1.17.jar:6.1.17] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1239) [jetty-6.1.17.jar:6.1.17] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) [jetty-6.1.17.jar:6.1.17] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466) [jetty-6.1.17.jar:6.1.17] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.17.jar:6.1.17] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jetty-6.1.17.jar:6.1.17] at org.mortbay.jetty.Server.doStart(Server.java:224) [jetty-6.1.17.jar:6.1.17] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.17.jar:6.1.17] at org.sonar.application.JettyEmbedder.start(JettyEmbedder.java:80) [sonar-application-2.0.1.jar:na] at org.sonar.application.StartServer.main(StartServer.java:45) [sonar-application-2.0.1.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_18] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [na:1.6.0_18] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [na:1.6.0_18] at java.lang.reflect.Method.invoke(Unknown Source) [na:1.6.0_18] at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:237) [wrapper.jar:3.3.0] at java.lang.Thread.run(Unknown Source) [na:1.6.0_18] Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [org.sonar.api.rules.Rule] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) [na:na] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) [na:na] at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64) [na:na] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176) [na:na] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656) [na:na] at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71) [na:na] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) [na:na] at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321) [na:na] at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) [na:na] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) [na:na] at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49) [na:na] at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154) [na:na] at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110) [na:na] at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61) [na:na] at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646) [na:na] at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620) [na:na] at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624) [na:na] at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220) [na:na] at org.sonar.api.database.DatabaseSession.internalSave(DatabaseSession.java:118) [na:na] at org.sonar.api.database.DatabaseSession.save(DatabaseSession.java:95) [na:na] at org.sonar.server.startup.RuleLoader.addNewRule(RuleLoader.java:105) [na:na] at org.sonar.server.startup.RuleLoader.start(RuleLoader.java:67) [na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_18] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [na:1.6.0_18] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [na:1.6.0_18] at java.lang.reflect.Method.invoke(Unknown Source) [na:1.6.0_18] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) [na:na] ... 28 common frames omitted Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'rules_category_id' cannot be null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.6.0_18] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [na:1.6.0_18] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [na:1.6.0_18] at java.lang.reflect.Constructor.newInstance(Unknown Source) [na:1.6.0_18] at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.Util.getInstance(Util.java:381) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937) [mysql-connector-java-5.1.6.jar:na] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922) [mysql-connector-java-5.1.6.jar:na] at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) [na:na] at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94) [na:na] at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57) [na:na] ... 52 common frames omitted 2010.04.01 17:15:46 INFO org.sonar.INFO Sonar started: http://0.0.0.0:9000/

    SonarSource JIRA | 7 years ago | bert kandert
    org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.server.startup.RuleLoader.start()', instance 'org.sonar.server.startup.RuleLoader@1202f4d, org.hibernate.exception.ConstraintViolationException: could not insert: [org.sonar.api.rules.Rule]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Duplicate entry '1' for key 'UK_tbce3olw19taxx6srova86xok'

    Stack Overflow | 3 years ago | Vad
    org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

  1. DoktorDoener666 6 times, last 3 weeks ago
  2. mauritius 1 times, last 3 weeks ago
  3. mauritius 2 times, last 1 month ago
  4. dafman 6 times, last 2 months ago
  5. davidvanlaatum 4 times, last 2 months ago
11 more registered users
45 unregistered visitors
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. com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException

    Duplicate entry '1-keys' for key 'datasource_id'

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0()
  2. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    4 frames
  3. MySQL jdbc
    PreparedStatement.executeUpdate
    1. com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    2. com.mysql.jdbc.Util.getInstance(Util.java:386)
    3. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
    4. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190)
    5. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122)
    6. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570)
    7. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)
    8. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2818)
    9. com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2157)
    10. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2460)
    11. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2377)
    12. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2361)
    12 frames
  4. Commons DBCP
    DelegatingPreparedStatement.executeUpdate
    1. org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    2. org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    2 frames
  5. Hibernate
    AbstractEntityPersister.insert
    1. org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
    2. org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
    3. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329)
    4. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2836)
    4 frames
  6. Hibernate
    EntityIdentityInsertAction.execute
    1. org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
    1 frame
  7. Hibernate
    ActionQueue.execute
    1. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267)
    1 frame
  8. Hibernate
    SessionImpl.save
    1. org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
    2. org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
    3. org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
    4. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
    5. org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
    6. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
    7. org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
    8. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
    9. org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:705)
    10. org.hibernate.impl.SessionImpl.save(SessionImpl.java:693)
    11. org.hibernate.impl.SessionImpl.save(SessionImpl.java:689)
    11 frames
  9. org.obiba.magma
    HibernateDatasource.createWriter
    1. org.obiba.magma.datasource.hibernate.HibernateDatasource.createWriter(HibernateDatasource.java:92)
    1 frame
  10. org.obiba.opal
    DefaultIdentifiersTableService$2.doInTransactionWithoutResult
    1. org.obiba.opal.core.service.impl.DefaultIdentifiersTableService$2.doInTransactionWithoutResult(DefaultIdentifiersTableService.java:155)
    1 frame
  11. 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
  12. org.obiba.opal
    FunctionalUnitsResource.getEntitiesTable
    1. org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getDatasource(DefaultIdentifiersTableService.java:148)
    2. org.obiba.opal.core.service.impl.DefaultIdentifiersTableService.getValueTable(DefaultIdentifiersTableService.java:77)
    3. org.obiba.opal.web.FunctionalUnitsResource.getEntitiesTable(FunctionalUnitsResource.java:224)
    3 frames
  13. 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:606)
    4 frames
  14. 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
  15. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    1 frame
  16. 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
  17. org.obiba.opal
    OpalJettyServer$TransactionFilter$1.doInTransactionWithoutResult
    1. org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter$1.doInTransactionWithoutResult(OpalJettyServer.java:296)
    1 frame
  18. 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
  19. org.obiba.opal
    OpalJettyServer$TransactionFilter.doFilterInternal
    1. org.obiba.opal.server.httpd.OpalJettyServer$TransactionFilter.doFilterInternal(OpalJettyServer.java:292)
    1 frame
  20. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    1 frame
  21. Jetty
    ServletHandler$CachedChain.doFilter
    1. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
    1 frame
  22. 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
  23. Jetty
    ServletHandler$CachedChain.doFilter
    1. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
    1 frame
  24. org.obiba.opal
    AuthenticationFilter.doFilterInternal
    1. org.obiba.opal.server.httpd.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:82)
    1 frame
  25. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    1 frame
  26. Jetty
    ServletHandler$CachedChain.doFilter
    1. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
    1 frame
  27. org.obiba.opal
    OpalJettyServer$OpalVersionFilter.doFilterInternal
    1. org.obiba.opal.server.httpd.OpalJettyServer$OpalVersionFilter.doFilterInternal(OpalJettyServer.java:276)
    1 frame
  28. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    1 frame
  29. 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
  30. 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
  31. 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
  32. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:724)
    1 frame