Results 1 to 2 of 2

Thread: setter method called twice for extended FixedLengthTokenizer

  1. #1
    Join Date
    Jun 2011
    Posts
    4

    Default setter method called twice for extended FixedLengthTokenizer

    Hi,
    I customized the FixedLengthTokenizer and included a property for it. if there is any exception arise in the setter method it is calling twice.

    Here is my code Snippet
    Code:
    public class ExtendFixedTokenizer extends FixedLengthTokenizer {
    	private String formatFile;
    
    	public void setFormatFile(String formatFile) throws Exception {
    		System.out.println("formatFile"+formatFile);
    		this.formatFile = formatFile;
                    //calling a method which throws exception
    	}
    }
    if there is any exception in the method the bean is loading again after it register the status in the jobRepositary. Also let me know if further details required

    Please advice if any thing wrong in this.

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

    Default

    I think you have to be a bit more specific about how the method is being called, and by whom. Did the exception occur during a Step execution (e.g. because of a StepScope component including the tokenizer)? If so, I can imagine the Step might be executed again if your Job is configured that way, but we don't really know enough to guess. Or did it fail on start up of the application context?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •