Announcement Announcement Module
Collapse
No announcement yet.
org.springframework.batch.item.ItemStreamException : Failed to initialize the reader Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.springframework.batch.item.ItemStreamException : Failed to initialize the reader

    I am getting exception in my log as below:

    dbo.bldg building0_
    2012-05-21 02:10:00,839 SimpleAsyncTaskExecutor-4 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01
    2012-05-21 02:10:00,839 SimpleAsyncTaskExecutor-4 ERROR org.hibernate.util.JDBCExceptionReporter - I/O Error: Connection reset
    2012-05-21 02:10:00,839 SimpleAsyncTaskExecutor-4 ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error executing the step
    org.springframework.batch.item.ItemStreamException : Failed to initialize the reader
    at org.springframework.batch.item.support.AbstractIte mCountingItemStreamItemReader.open(AbstractItemCou ntingItemStreamItemReader.java:137)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:183)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :150)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy9.open(Unknown Source)
    at org.springframework.batch.item.support.CompositeIt emStream.open(CompositeItemStream.java:98)
    at org.springframework.batch.core.step.tasklet.Taskle tStep.open(TaskletStep.java:288)
    at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:193)
    at org.springframework.batch.core.job.SimpleStepHandl er.handleStep(SimpleStepHandler.java:135)
    at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep(JobFlowExecutor.java:61)
    at org.springframework.batch.core.job.flow.support.st ate.StepState.handle(StepState.java:60)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:144)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:135)
    at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:281)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:120)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query using scroll
    at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:74)
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
    at org.hibernate.loader.Loader.scroll(Loader.java:232 8)
    at org.hibernate.loader.hql.QueryLoader.scroll(QueryL oader.java:441)
    at org.hibernate.hql.ast.QueryTranslatorImpl.scroll(Q ueryTranslatorImpl.java:390)
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:135)
    at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:281)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:120)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query using scroll
    at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:74)
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
    at org.hibernate.loader.Loader.scroll(Loader.java:232 8)
    at org.hibernate.loader.hql.QueryLoader.scroll(QueryL oader.java:441)
    at org.hibernate.hql.ast.QueryTranslatorImpl.scroll(Q ueryTranslatorImpl.java:390)
    at org.hibernate.engine.query.HQLQueryPlan.performScr oll(HQLQueryPlan.java:245)
    at org.hibernate.impl.StatelessSessionImpl.scroll(Sta telessSessionImpl.java:586)
    at org.hibernate.impl.QueryImpl.scroll(QueryImpl.java :67)
    at org.springframework.batch.item.database.HibernateI temReaderHelper.getForwardOnlyCursor(HibernateItem ReaderHelper.java:126)
    at org.springframework.batch.item.database.HibernateC ursorItemReader.doOpen(HibernateCursorItemReader.j ava:183)
    at org.springframework.batch.item.support.AbstractIte mCountingItemStreamItemReader.open(AbstractItemCou ntingItemStreamItemReader.java:134)
    ... 24 more
    Caused by: java.sql.SQLException: I/O Error: Connection reset
    at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCo re.java:1053)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL Query(JtdsStatement.java:465)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.ex ecuteQuery(JtdsPreparedStatement.java:778)
    at org.apache.commons.dbcp.DelegatingPreparedStatemen t.executeQuery(DelegatingPreparedStatement.java:93 )
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(Ab stractBatcher.java:186)
    at org.hibernate.loader.Loader.getResultSet(Loader.ja va:1787)
    at org.hibernate.loader.Loader.scroll(Loader.java:229 3)
    ... 32 more
    Caused by: java.net.SocketException: Connection reset
    at java.net.SocketOutputStream.socketWrite(SocketOutp utStream.java:96)
    at java.net.SocketOutputStream.write(SocketOutputStre am.java:136)
    at java.io.DataOutputStream.write(DataOutputStream.ja va:90)
    at net.sourceforge.jtds.jdbc.SharedSocket.sendNetPack et(SharedSocket.java:672)
    at net.sourceforge.jtds.jdbc.RequestStream.putPacket( RequestStream.java:560)
    at net.sourceforge.jtds.jdbc.RequestStream.flush(Requ estStream.java:508)
    at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCo re.java:1040)
    ... 38 more
    2012-05-21 02:10:00,840 SimpleAsyncTaskExecutor-4 DEBUG edu.ucdavis.kc.batch.listener.FacilityStepListener - afterStep - begins..
    java.lang.NullPointerException
    at edu.ucdavis.kc.batch.listener.FacilityStepListener .afterStep(FacilityStepListener.java:58)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.batch.support.SimpleMethodInvo ker.invokeMethod(SimpleMethodInvoker.java:105)
    at org.springframework.batch.core.listener.MethodInvo kerMethodInterceptor.invoke(MethodInvokerMethodInt erceptor.java:68)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy12.afterStep(Unknown Source)
    at org.springframework.batch.core.listener.CompositeS tepExecutionListener.afterStep(CompositeStepExecut ionListener.java:62)
    at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:224)
    at org.springframework.batch.core.job.SimpleStepHandl er.handleStep(SimpleStepHandler.java:135)
    at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep(JobFlowExecutor.java:61)
    at org.springframework.batch.core.job.flow.support.st ate.StepState.handle(StepState.java:60)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:144)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:135)
    at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:281)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:120)
    at java.lang.Thread.run(Thread.java:619)

  • #2
    here is spring batch xml file. I had added scope="step" but still i am still getting this error. any ideas what could be problem.
    both of my source and target database are Up, I don't know why i get above posted Exception.

    <job id="kualiCoeusJob" xmlns="http://www.springframework.org/schema/batch" >
    <step id="facilityLoad">
    <tasklet transaction-manager="hibernate-transactionManager">
    <chunk reader="facilityItemReader"
    writer="facilityItemWriter"
    commit-interval="${batch.job.local.commitInterval}" />
    <listeners>
    <listener ref="facilityStepListener"/>
    </listeners>
    </tasklet>
    </step>
    </job>

    <bean id="facilityItemReader" scope="step"
    class="org.springframework.batch.item.database.Hib ernateCursorItemReader">
    <property name="queryString" value=" from Building" />
    <property name="sessionFactory" ref="infrastructure-SessionFactory" />
    </bean>

    <bean id="facilityItemWriter"
    class="edu.ucdavis.kc.batch.tasklet.UcdInstitution LocationItemWriter">
    <property name="sessionFactory" ref="hibernate-SessionFactory" />
    <property name="dao" ref="facilityDao" />
    </bean>

    <bean id="facilityDao"
    class="edu.ucdavis.kc.batch.dao.UcdInstitutionLoca tionImplDao">
    <property name="sessionFactory" ref="hibernate-SessionFactory"/>
    </bean>

    <bean id="facilityStepListener" class="edu.ucdavis.kc.batch.listener.FacilityStepL istener"/>

    Comment

    Working...
    X