Announcement Announcement Module
No announcement yet.
Can not see any log Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can not see any log

    Hi all,

    I am trying to read data from database and want to print those data to see if it is working. But the problem is that while I am trying to print the record in Mapper class I can not see anything else though there is one record present in resultset.
    As I am a newbie I want to know that while processing the input records I should see the records in this Mapper class while setting values in VO.right?

    How can I connect the resultset with the writer?
    Please give me the code which will print this resultset in Console.None of my print is giving output. Please help.

    My codes are given below:-

    <job id="counterJob">
    		<step id="fetchRecord">
    				<chunk reader="inputMemberSource" writer="opWriter" 
    	                   commit-interval="1" />
    	<beans:bean id="inputMemberSource" class="org.springframework.batch.item.database.JdbcCursorItemReader">
    		<beans:property name="dataSource" ref="dataSource" />
    		<beans:property name="rowMapper">
    			<beans:bean class="com.test.dao.MemberDetailsMapper" />
    		<beans:property name="sql">
    			<beans:value>SELECT * FROM XX</beans:value>
    	<beans:bean id="opWriter" class="com.test.dao.OpWriter">
    	<beans:property name="dataSource" ref="dataSource" />	
    public class OpWriter extends SimpleJdbcDaoSupport implements ItemWriter<MembersDetails>{
    	private Logger log = Logger.getLogger(OpWriter.class); 
    	public void write(List<? extends MembersDetails> mbrs) throws Exception {"SIZE............."+mbrs.size());
    		for(MembersDetails mbr: mbrs)
    public class MemberDetailsMapper implements ParameterizedRowMapper<MembersDetails>{
    	private Logger log = Logger.getLogger(MemberDetailsMapper.class); 
    	public MembersDetails mapRow(ResultSet rs, int number) throws SQLException {
    		MembersDetails mbrDetails = new MembersDetails();
    		System.out.println("MemberDetailsMapper/mapRow-> "+rs.getString("TRANSACTIONID"));"MemberDetailsMapper/mapRow-> "+rs.getString("TRANSACTIONID"));
    return mbrDetails;

    18:14:08,636 INFO andLineJobRunner.main() PropertyOverrideConfigur
    er:178 - Loading properties file from class path resource []
    18:14:08,683 INFO andLineJobRunner.main() ClassPathXmlApplicationC
    ontext:1196 - Bean 'jobRegistry' is not eligible for getting processed by all BeanPostProcessors (for example: not el
    igible for auto-proxying)
    18:14:08,698 INFO andLineJobRunner.main() DefaultListableBeanFacto
    ry:414 - Pre-instantiating singletons in istableBeanFactory@16de067
    : defining beans [jobLauncher,org.springframework.batch.core.configu,job
    Repository,incrementerFactory,jobOperator,jobExplo rer,jobRegistry,jdbcTemplate,logAdvice,eventAdvice ,dataSource,trans
    actionManager,environment,overrideProperties,place holderProperties, ope.internalStepS
    cope,org.springframework.beans.factory.config.Cust omEditorConfigurer,fetchRecord,counterJob,inputMem berSource,opWrite
    r]; root of factory hierarchy
    18:14:08,901 INFO andLineJobRunner.main() SimpleJobLauncher:156 -
    No TaskExecutor has been set, defaulting to synchronous executor.
    18:14:18,199 INFO andLineJobRunner.main() SimpleJobLauncher:109 -
    Job: [FlowJob: [name=counterJob]] launched with the following parameters: [{}]
    18:14:18,230 DEBUG andLineJobRunner.main() AbstractJob:238 - Job ex
    ecution starting: JobExecution: id=0, startTime=null, endTime=null, lastUpdated=Mon Oct 04 18:14:17 IST 2010, status=
    STARTING, exitStatus=exitCode=UNKNOWN;exitDescription=, job=[JobInstance: id=0, JobParameters=[{}], Job=[counterJob]]

    18:14:18,512 DEBUG andLineJobRunner.main() SimpleFlow:135 - Resumin
    g state=fetchRecord with status=UNKNOWN
    18:14:18,512 DEBUG andLineJobRunner.main() SimpleFlow:143 - Handlin
    g state=fetchRecord
    18:14:19,418 INFO andLineJobRunner.main() AbstractJob:347 - Execut
    ing step: [TaskletStep: [name=fetchRecord]]
    18:14:19,418 DEBUG andLineJobRunner.main() AbstractStep:182 - Execu
    ting: id=0
    18:14:23,715 DEBUG andLineJobRunner.main() RepeatTemplate:463 - Sta
    rting repeat context.
    18:14:23,715 DEBUG andLineJobRunner.main() RepeatTemplate:365 - Rep
    eat operation about to start at count=1
    18:14:23,762 DEBUG andLineJobRunner.main() RepeatTemplate:463 - Sta
    rting repeat context.
    18:14:23,762 DEBUG andLineJobRunner.main() RepeatTemplate:365 - Rep
    eat operation about to start at count=1
    18:14:23,762 DEBUG andLineJobRunner.main() RepeatTemplate:436 - Rep
    eat is complete according to policy and result value.
    18:14:23,762 DEBUG andLineJobRunner.main() TaskletStep:275 - Applyi
    ng contribution: [StepContribution: read=0, written=0, filtered=0, readSkips=0, writeSkips=0, processSkips=0, exitSta
    18:14:24,059 DEBUG andLineJobRunner.main() TaskletStep:299 - Saving
    step execution after commit: StepExecution: id=0, name=fetchRecord, status=STARTED, exitStatus=EXECUTING, readCount=
    0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, commitCount=1, rollbackCount=0, exitDescription=
    18:14:24,371 DEBUG andLineJobRunner.main() RepeatTemplate:436 - Rep
    eat is complete according to policy and result value.
    18:14:24,371 DEBUG andLineJobRunner.main() AbstractStep:210 - Step
    execution success: id=0
    18:14:24,965 DEBUG andLineJobRunner.main() AbstractStep:264 - Step
    execution complete: StepExecution: id=0, name=fetchRecord, status=COMPLETED, exitStatus=COMPLETED, readCount=0, filte
    rCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, commitCount=1, rollbackCount=0
    18:14:25,246 DEBUG andLineJobRunner.main() SimpleFlow:152 - Complet
    ed state=fetchRecord with status=COMPLETED
    18:14:25,246 DEBUG andLineJobRunner.main() SimpleFlow:143 - Handlin
    g state=end1
    18:14:25,246 DEBUG andLineJobRunner.main() SimpleFlow:152 - Complet
    ed state=end1 with status=COMPLETED
    18:14:25,246 DEBUG andLineJobRunner.main() AbstractJob:251 - Job ex
    ecution complete: JobExecution: id=0, startTime=Mon Oct 04 18:14:18 IST 2010, endTime=null, lastUpdated=Mon Oct 04 18
    :14:18 IST 2010, status=COMPLETED, exitStatus=exitCode=COMPLETED;exitDescription=, job=[JobInstance: id=0, JobParamet
    ers=[{}], Job=[counterJob]]
    18:14:25,543 INFO andLineJobRunner.main() SimpleJobLauncher:111 -
    Job: [FlowJob: [name=counterJob]] completed with the following parameters: [{}] and the following status: [COMPLETED]

    18:14:25,543 INFO andLineJobRunner.main() ClassPathXmlApplicationC
    ontext:815 - Closing plicationContext@109de5b: display name [org.sp ionContext@109de5b]; startup date [Mon Oct 04 18:14:07 IST 2010]; r
    oot of context hierarchy
    18:14:25,543 INFO andLineJobRunner.main() DefaultListableBeanFacto
    ry:421 - Destroying singletons in istableBeanFactory@16de067: defin
    ing beans [jobLauncher,org.springframework.batch.core.configu,jobR eposit
    ory,incrementerFactory,jobOperator,jobExplorer,job Registry,jdbcTemplate,logAdvice,eventAdvice,dataSo urce,transactionM
    anager,environment,overrideProperties,placeholderP roperties, ernalStepScope,or
    g.springframework.beans.factory.config.CustomEdito rConfigurer,fetchRecord,counterJob,inputMemberSour ce,opWriter]; roo
    t of factory hierarchy
    Last edited by kousik.majumder; Oct 4th, 2010, 07:55 AM.

  • #2

    My problem is solved. Actually resultset had no record.