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 Stack Overflow by Xingxue Liao
, 1 year ago
could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
via GitHub by sockeqwe
, 7 months ago
could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
via GitHub by zxwing
, 2 years ago
could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
via Stack Overflow by alveomaster
, 5 months ago
could not execute statement; SQL [n/a]; constraint [profiles_registration_number_key]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
via Stack Overflow by RIPI
, 1 year ago
could not execute statement; SQL [n/a]; constraint [SYS_PK_10110]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
via Stack Overflow by Áron Nemmondommegavezetéknevem
, 2 years ago
could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`oacg_auth`.`role_allowed_permissions`, CONSTRAINT `FKijs5duidxepjv5l070cebl1a` FOREIGN KEY (`allowed_permissions_id`) REFERENCES `permission` (`id`))	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)	at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)	at com.mysql.jdbc.Util.getInstance(Util.java:387)	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:934)	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)	at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)	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:3198)	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3435)	at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:98)	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:1282)	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:465)	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:2963)	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2339)	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:485)	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:231)	at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:65)	at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:61)	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:483)	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:290)	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 com.oacg.auth.web.PermissionRestController$$EnhancerBySpringCGLIB$$d7c8d359.delete()	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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114)	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)	at org.springframework.web.servlet.FrameworkServlet.doDelete(FrameworkServlet.java:894)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:654)	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:105)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:121)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:107)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)	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)