-
Mar 16th, 2009, 12:12 AM
#1
writeFooter not called
Hi guys,
I have a CustomFlatFileItemWriter which extends FlatFileItemWriter and implements FlatFileFooterCallback.
My file gets created and all the contents gets written, except for my footer.
It seem to me as if my writeFooter method is not called at all.
Am I missing something?
-
Mar 16th, 2009, 02:06 AM
#2
Did you remember to call setFooterCallback(this)?
-
Mar 16th, 2009, 02:11 AM
#3
I have now since changed my implementation according to the delegate patterns as set out in the docs.
That is my CustomWriter now implements ItemWriter instead of extending FlatFileItemWriter.
I now have my FlatFileItemWriter as a delegate.
all is well execpt that I now get a writer must be open before it can be written to error.
I have implemented ItemStream and overridden the open method, but how do I actually open my delegate flatFileItemWriter to avoid this error?
-
Mar 16th, 2009, 09:43 AM
#4
either have your composite writer's open() method call "delegate.open()", or configure the delegate itself to be a stream.
-
Mar 16th, 2009, 04:30 PM
#5
You should register the delegate as a stream. Any readers or writers directly wired into a step will be auto-detected, but the framework has no way of knowing what 'transitive dependencies' of readers and writers may be using that are also ItemStreams.
-
Mar 17th, 2009, 12:43 AM
#6
Thanks, did that and it worked like a charm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules