Results 1 to 6 of 6

Thread: writeFooter not called

  1. #1
    Join Date
    Mar 2009
    Posts
    130

    Default 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?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    Did you remember to call setFooterCallback(this)?

  3. #3
    Join Date
    Mar 2009
    Posts
    130

    Default

    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?

  4. #4
    Join Date
    Feb 2008
    Posts
    488

    Default

    either have your composite writer's open() method call "delegate.open()", or configure the delegate itself to be a stream.

  5. #5
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    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.

  6. #6
    Join Date
    Mar 2009
    Posts
    130

    Default

    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
  •