hibernate - Incorrect format date in java -
i trouble work. : in proj , got strange exception(below),i check code, found entitymanager.flush() method throw out exception.i find may entitymanager.persist() method trouble. our customer told me exception occurs when run job, , when run job again,it successed.i think should not problem code,because if ,it not successed when run job twice. think if there exist bug when calendar.addmonth() or calendar.addday(). can't clear. have ever see ? why there incorrect format date ?
2013-07-11 20:35:50,504 error [org.hibernate.util.jdbcexceptionreporter] batch entry 0 insert statementitem (account_accountid, amountdue, amountpaid, createdate, financiatransactiontype_transactiontypeid, information, pending, periodend, periodstart, relatedstatement, sequencenumber, statementitems_statementid, verification_verificationid, statementitemid) values (null, '15.0', '0.0', null, 'statement fee', 'direct_debit_statement_fee', '0', '0008-07-28 00:00:00.000000 +01:00:00', '20137037-04-08 00:00:00.000000 +02:00:00', '1043', '3', '140034086', '140034090', '140034091') aborted. call getnextexception see cause. 2013-07-11 20:35:50,504 error [org.hibernate.util.jdbcexceptionreporter] error: timestamp out of range: "20137037-04-08 00:00:00.000000 +02:00:00" 2013-07-11 20:35:50,505 error [org.hibernate.event.def.abstractflushingeventlistener] not synchronize database state session org.hibernate.exception.dataexception: not execute jdbc batch update @ org.hibernate.exception.sqlstateconverter.convert(sqlstateconverter.java:100) @ org.hibernate.exception.jdbcexceptionhelper.convert(jdbcexceptionhelper.java:66) @ org.hibernate.jdbc.abstractbatcher.executebatch(abstractbatcher.java:275) @ org.hibernate.jdbc.abstractbatcher.preparestatement(abstractbatcher.java:114) @ org.hibernate.jdbc.abstractbatcher.preparestatement(abstractbatcher.java:109) @ org.hibernate.jdbc.abstractbatcher.preparebatchstatement(abstractbatcher.java:244) @ org.hibernate.persister.entity.abstractentitypersister.insert(abstractentitypersister.java:2252) @ org.hibernate.persister.entity.abstractentitypersister.insert(abstractentitypersister.java:2688) @ org.hibernate.action.entityinsertaction.execute(entityinsertaction.java:79) @ org.hibernate.engine.actionqueue.execute(actionqueue.java:279) @ org.hibernate.engine.actionqueue.executeactions(actionqueue.java:263) @ org.hibernate.engine.actionqueue.executeactions(actionqueue.java:167) @ org.hibernate.event.def.abstractflushingeventlistener.performexecutions(abstractflushingeventlistener.java:321) @ org.hibernate.event.def.defaultflusheventlistener.onflush(defaultflusheventlistener.java:50) @ org.hibernate.impl.sessionimpl.flush(sessionimpl.java:1027) @ org.hibernate.ejb.abstractentitymanagerimpl.flush(abstractentitymanagerimpl.java:304) @ org.jboss.jpa.tx.transactionscopedentitymanager.flush(transactionscopedentitymanager.java:216) @ greenback.backend.dao.beans.performancedaobean.updateaccount(performancedaobean.java:707) @ sun.reflect.generatedmethodaccessor765.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.jboss.aop.joinpoint.methodinvocation.invoketarget(methodinvocation.java:122) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:111) @ org.jboss.ejb3.ejbcontainerinvocationwrapper.invokenext(ejbcontainerinvocationwrapper.java:69) @ org.jboss.ejb3.interceptors.aop.interceptorsequencer.invoke(interceptorsequencer.java:73) @ org.jboss.ejb3.interceptors.aop.interceptorsequencer.aroundinvoke(interceptorsequencer.java:59) @ sun.reflect.generatedmethodaccessor711.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.jboss.aop.advice.perjoinpointadvice.invoke(perjoinpointadvice.java:174) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor.fillmethod(invocationcontextinterceptor.java:72) @ org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor_z_fillmethod_1529847521.invoke(invocationcontextinterceptor_z_fillmethod_1529847521.java) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor.setup(invocationcontextinterceptor.java:88) @ org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor_z_setup_1529847521.invoke(invocationcontextinterceptor_z_setup_1529847521.java) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.connectionmanager.cachedconnectioninterceptor.invoke(cachedconnectioninterceptor.java:62) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.entity.transactionscopedentitymanagerinterceptor.invoke(transactionscopedentitymanagerinterceptor.java:56) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.allowedoperationsinterceptor.invoke(allowedoperationsinterceptor.java:47) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.tx.nullinterceptor.invoke(nullinterceptor.java:42) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor_z_fillmethod_1529847521.invoke(invocationcontextinterceptor_z_fillmethod_1529847521.java) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor.setup(invocationcontextinterceptor.java:88) @ org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor_z_setup_1529847521.invoke(invocationcontextinterceptor_z_setup_1529847521.java) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.connectionmanager.cachedconnectioninterceptor.invoke(cachedconnectioninterceptor.java:62) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.entity.transactionscopedentitymanagerinterceptor.invoke(transactionscopedentitymanagerinterceptor.java:56) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.allowedoperationsinterceptor.invoke(allowedoperationsinterceptor.java:47) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.tx.nullinterceptor.invoke(nullinterceptor.java:42) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.stateless.statelessinstanceinterceptor.invoke(statelessinstanceinterceptor.java:68) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.aspects.tx.txpolicy.invokeincallertx(txpolicy.java:126) @ org.jboss.aspects.tx.txinterceptor$required.invoke(txinterceptor.java:194) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.aspects.tx.txpropagationinterceptor.invoke(txpropagationinterceptor.java:76) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.tx.nullinterceptor.invoke(nullinterceptor.java:42) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.security.rolebasedauthorizationinterceptorv2.invoke(rolebasedauthorizationinterceptorv2.java:201) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.security.ejb3authenticationinterceptorv2.invoke(ejb3authenticationinterceptorv2.java:186) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.encpropagationinterceptor.invoke(encpropagationinterceptor.java:41) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.blockcontainershutdowninterceptor.invoke(blockcontainershutdowninterceptor.java:67) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.aspects.currentinvocation.currentinvocationinterceptor.invoke(currentinvocationinterceptor.java:67) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:102) @ org.jboss.ejb3.session.sessionspeccontainer.invoke(sessionspeccontainer.java:176) @ org.jboss.ejb3.session.sessionspeccontainer.invoke(sessionspeccontainer.java:216) @ org.jboss.ejb3.proxy.impl.handler.session.sessionproxyinvocationhandlerbase.invoke(sessionproxyinvocationhandlerbase.java:207) @ org.jboss.ejb3.proxy.impl.handler.session.sessionproxyinvocationhandlerbase.invoke(sessionproxyinvocationhandlerbase.java:164) @ $proxy1103.updateaccount(unknown source) @ greenback.backend.services.statement.statementservicebean.createstatementwithaccountnumberbatch(statementservicebean.java:589) @ greenback.backend.services.statement.statementservicebean.createstatement(statementservicebean.java:308) @ greenback.backend.services.statement.statementservicebean.createstatement(statementservicebean.java:162) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.jboss.aop.joinpoint.methodinvocation.invoketarget(methodinvocation.java:122) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:111) @ org.jboss.ejb3.ejbcontainerinvocationwrapper.invokenext(ejbcontainerinvocationwrapper.java:69) @ org.jboss.ejb3.interceptors.aop.invocationcontextinterceptor$invocationcontext.proceed(invocationcontextinterceptor.java:138) @ greenback.backend.security.authenticationinterceptor.intercept(authenticationinterceptor.java:52) @ sun.reflect.generatedmethodaccessor339.invoke(unknown source) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:330) @ org.apache.coyote.http11.http11processor.process(http11processor.java:829) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:598) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:447) @ java.lang.thread.run(thread.java:662) caused by: java.sql.batchupdateexception: batch entry 0 insert statementitem (account_accountid, amountdue, amountpaid, createdate, financiatransactiontype_transactiontypeid, information, pending, periodend, periodstart, relatedstatement, sequencenumber, statementitems_statementid, verification_verificationid, statementitemid) values (null, '15.0', '0.0', null, 'statement fee', 'direct_debit_statement_fee', '0', '0008-07-28 00:00:00.000000 +01:00:00', '20137037-04-08 00:00:00.000000 +02:00:00', '1043', '3', '140034086', '140034090', '140034091') aborted. call getnextexception see cause. @ org.postgresql.jdbc2.abstractjdbc2statement$batchresulthandler.handleerror(abstractjdbc2statement.java:2569) @ org.postgresql.core.v3.queryexecutorimpl.processresults(queryexecutorimpl.java:1796) @ org.postgresql.core.v3.queryexecutorimpl.execute(queryexecutorimpl.java:407) @ org.postgresql.jdbc2.abstractjdbc2statement.executebatch(abstractjdbc2statement.java:2708) @ org.jboss.resource.adapter.jdbc.wrappedstatement.executebatch(wrappedstatement.java:774) @ org.hibernate.jdbc.batchingbatcher.doexecutebatch(batchingbatcher.java:70) @ org.hibernate.jdbc.abstractbatcher.executebatch(abstractbatcher.java:268) ... 362 more 2013-07-11 20:35:50,584 error [org.jboss.aspects.tx.txpolicy] javax.ejb.ejbtransactionrolledbackexception: org.hibernate.exception.dataexception: not execute jdbc batch update
in jpa entity class, kind of temporaltype use? try this:
@temporal(temporaltype.timestamp)
Comments
Post a Comment