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

    MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg

  2. ,

    Make sure you are using InnoDB storage engine and READ-COMMITTED transaction isolation level and increase the database server innodb_lock_wait_timeout variable to about 500.

Solutions on the web

via Stack Overflow by umapathi
, 1 year ago
could not insert: [com.tta.abcd.model.Child]
via Coderanch by Samanthi perera, 1 year ago
could not insert: [Employee]
via csdn.net by Unknown author, 2 years ago
via Oracle Community by david_l_l, 1 year ago
via Stack Overflow by Inayathulla
, 2 years ago
java.sql.SQLException: Field 'parentId' doesn't have a default value	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2427)	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2345)	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2330)	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:2345)	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2852)	at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)	at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)	at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)	at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)	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:713)	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)	at com.tta.abcd.DAO.ProduceDAO.saveProduce(ProduceDAO.java:61)	at com.tta.abcd.service.ProduceServiceImpl.saveProduce(ProduceServiceImpl.java:23)	at com.tta.abcd.service.ProduceServiceImpl$$FastClassByCGLIB$$a6eaa4a0.invoke()	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:639)	at com.tta.abcd.service.ProduceServiceImpl$$EnhancerByCGLIB$$79bed302.saveProduce()	at com.tta.abcd.controller.ProduceController.saveProduce(ProduceController.java:138)	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.invoke(InvocableHandlerMethod.java:219)	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:747)	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:688)	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:946)	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:848)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:822)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100)	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)	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)