javalist超出范围,SQL错误17268:年份超出范围
(JavaSpring)
当我在数据库上进⾏简单的SELECT时,我遇到了与Oracle / Hibernate相关的问题,⽽且在这个问题上我⽆法找到任何有⽤的信息.该应⽤程序使⽤Spring Data⾃⾏创建查询.该数据库是Oracle 11.02.0.4,以及相同版本的JDBC驱动程序.
SQL错误是17268:年份超出范围.
我知道这个消息⾮常明显,但是当在数据库上⼿动打印⽇志时,我没有问题,并且看到⽇期字段的年份设置为2016 …
我尝试使⽤Java对象映射Date和Timestamp上的那些字段,同样的错误.奇怪的是,问题突然出现在客户端,我⽆法在我⾃⼰的环境中重现该问题(客户端正在运⾏WebSphere 8.5.5).
任何可能出现此错误的指针,或者我应该调查什么?
请参阅下⾯的堆栈跟踪
[11/14/16 12:05:03:370 CET] 000000d6 SystemOut O 12:05:03.370 [WebContainer : 1] WARN
jdbc.spi.SqlExceptionHelper - SQL Error: 17268, SQLState: 99999
[11/14/16 12:05:03:371 CET] 000000d6 SystemOut O 12:05:03.371 [WebContainer : 1] ERROR
jdbc.spi.SqlExceptionHelper - Year out of range.
[11/14/16 12:05:03:406 CET] 000000d6 ServletWrappe E com.ibm.ws.webcontainer.rvlet.ServletWrapper rvice SRVE0014E: Uncaught rvice() exception root cau dispatcher: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is jpa.JpaSystemException:
ption.GenericJDBCException: could not execute statement; nested exception is
javax.persistence.PersistenceException: ption.GenericJDBCException: could not execute statement
at org.springframework.web.rvlet.FrameworkServlet.processRequest(FrameworkServlet.java:979)
at org.springframework.web.rvlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
at javax.rvlet.http.HttpServlet.rvice(HttpServlet.java:575)
at org.springframework.web.rvlet.FrameworkServlet.rvice(FrameworkServlet.java:843)
at javax.rvlet.http.HttpServlet.rvice(HttpServlet.java:668)
at com.ibm.ws.webcontainer.rvlet.ServletWrapper.rvice(ServletWrapper.java:1232)
at com.ibm.ws.webcontainer.rvlet.ServletWrapper.handleRequest(ServletWrapper.java:781)
at com.ibm.ws.webcontainer.rvlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
at com.ibm.ws.webcontainer.rvlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3926)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1007)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
at com.ibm.ws.webcontainer.ady(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.ady(HttpInboundLink.java:287)
at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1049)
at com.ibm.ws.ssl.channel.impl.plete(SSLConnectionLink.java:643)
at
com.ibm.ws.ssl.channel.impl.plete(SSLReadServiceContext.java:1818)
at com.p.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.pleted(AsyncFuture.java:138)
at com.ibm.io.plete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
Caud by: jpa.JpaSystemException: ption.GenericJDBCException: could not
execute statement; nested exception is javax.persistence.PersistenceException:
ption.GenericJDBCException: could not execute statement
at
vertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:415)
at
anslateExceptionIfPossible(AbstractEntityManagerFactoryBean.j
at
org.springframework.dao.anslateExceptionIfPossible(ChainedPersistenceExceptio
at org.springframework.dao.anslateIfNecessary(DataAccessUtils.java:213)
at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.ja
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.pository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInter
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvoc
ation.java:179)
at org.springframework.aop.interceptor.ExpoInvocationInterceptor.invoke(ExpoInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy83.findByEnvelopeIdAndStatusInAndCurrentVersionOrderByTecidAsc(Unknown Source)
...
at lib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvidInterceptor.intercept(CglibAopProxy.java:649)
...
at lib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvidInterceptor.intercept(CglibAopProxy.java:649)
...
at lib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at
ansaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at
ansaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:28
at ansaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvidInterceptor.intercept(CglibAopProxy.java:653)
...
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at flect.Method.invoke(Method.java:620)
at org.hod.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.hod.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at
org.springframework.web.hod.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandle
at
org.springframework.web.hod.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHa
at
org.springframework.web.hod.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerA
at
org.springframework.web.hod.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.rvlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.rvlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.rvlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
... 29 more
Caud by: javax.persistence.PersistenceException: ption.GenericJDBCException: could not execute
statement
at org.hibernate.jpa.vert(AbstractEntityManagerImpl.java:1763)
at org.hibernate.jpa.vert(AbstractEntityManagerImpl.java:1677)
at org.hibernate.jpa.ResultList(QueryImpl.java:458)
at org.ResultList(CriteriaQueryTypeQueryAdapter.java:67)
at
org.springframework.pository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:110)
at org.springframework.pository.ute(JpaQueryExecution.java:74)
at org.springframework.pository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.jav
a:97)
at org.springframework.pository.ute(AbstractJpaQuery.java:88)
at
org.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(Reposito
at
org.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryF
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
ansaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at
ansaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:28
at ansaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.ja
... 72 more
Caud by: ption.GenericJDBCException: could not execute statement
at ption.vert(StandardSQLExceptionConverter.java:54)
at ine.jdbc.vert(SqlExceptionHelper.java:126)
at ine.jdbc.vert(SqlExceptionHelper.java:112)
at ine.jdbc.uteUpdate(ResultSetReturnImpl.java:190)
at org.ity.AbstractEntityPersister.update(AbstractEntityPersister.java:3285)
at org.ity.AbstractEntityPersister.updateOrInrt(AbstractEntityPersister.java:3183)
at org.ity.AbstractEntityPersister.update(AbstractEntityPersister.java:3525)
at org.hibernate.action.ute(EntityUpdateAction.java:158)
at ine.uteActions(ActionQueue.java:453)
at ine.uteActions(ActionQueue.java:345)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350) at org.hibernate.event.AutoFlush(DefaultAutoFlushEventListener.java:67)
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1187)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1253)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573)
at org.hibernate.jpa.ResultList(QueryImpl.java:449)
.
.. 85 more
Caud by: java.sql.SQLException: Year out of range.
at oracle.jdbc.driver.DateCommonBinder.tOracleCYMD(OraclePreparedStatement.java:19395)
at oracle.jdbc.driver.TimestampBinder.bind(OraclePreparedStatement.java:19668)
at oracle.jdbc.driver.OraclePreparedStatement.tupBindBuffers(OraclePreparedStatement.java:3166)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2378)
at oracle.jdbc.uteInternal(OraclePreparedStatement.java:3608)
at oracle.jdbc.uteUpdate(OraclePreparedStatement.java:3694)
at oracle.jdbc.uteUpdate(OraclePreparedStatementWrapper.java:1354)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:1187)
at com.ibm.ws.rsadapter.uteUpdate(WSJdbcPreparedStatement.java:804)
at ine.jdbc.uteUpdate(ResultSetReturnImpl.java:187)
... 98 more
⽣成的查询:
lect
documentdb0_.tecid as tecid1_3_,
documentdb0_.comments_nb as comments_nb2_3_,
documentdb0_.content_path as content_path3_3_,
documentdb0_.content_size as content_size4_3_,
documentdb0_.creation_date as creation_date5_3_,
documentdb0_.creator as creator6_3_,
documentdb0_.current_version as current_version7_3_,
documentdb0_.docfamily as docfamily8_3_,
documentdb0_.doctype as doctype9_3_,