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. ,

    Check whether privilege has the "not null" restriction. If so it always has to have a value and can never be null.

    A different reason could be a wrong implementation of a foreign key. Check whether you always correctly insert/update in both tables.

  2. ,

    Nothing is wrong with the database. When it gives you those errors, it's telling you that you are trying to input "nothing" (null) into a column that doesn't allow it. Fix it by removing the not null constraint or by passing a value to that field.

Solutions on the web

via JIRA by Yannick Marcon, 1 year ago
could not insert: [org.obiba.magma.datasource.hibernate.domain.ValueTableState]
via JIRA by Yannick Marcon, 2 years ago
could not insert: [org.obiba.magma.datasource.hibernate.domain.ValueTableState]
via viralpatel.net by Unknown author, 1 year ago
could not insert: [net.viralpatel.docmanager.model.Document]
via Stack Overflow by ice spirit
, 7 months ago
via Coderanch by Baktha Elumalai, 1 year ago
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)	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)