This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

Passing Job Parameters to ItemWriter with Late BindingPage Title Module

I made these changes based on few threads in the spring-batch forum and chapter-5 of spring-batch documentation. But when I run the job, I get the following errors

Code:

Caused by: java.io.FileNotFoundException: class path resource [#{jobParameters['OUTFILE']}] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:162)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:47)
at org.springframework.batch.item.file.FlatFileItemWriter.getOutputState(FlatFileItemWriter.java:337)
... 55 more

Comment

Victor / Dave,
I am still having problems with job params. Actually snicoll had few suggestions regarding my problem. I think I am following documentation / samples for most part. But I guess there is something that is still missing. Just to recap, I am using Batch 2.1.1, Spring 3.0, Java 5.0, STS 2.3.1. To simply things, I created a Simple Batch Job(different from original post) from STS template. My Module context looks like this

Comment

You have a mixture of Spring 2.5.6 and Spring 3.0 in there. If you add an explicit dependency on spring-context and spring-aop I think it will work. (The sample project is fixed in trunk by the way, it just didn't make it to STS yet.)

Comment

Dave,
It worked after adding explicit dependency. I did not pay attention to the indirect dependency. I just checked spring-core and spring-beans versions and thought everything was OK. I was looking more at job initialization and job config files. Thanks for pointing out. I can move forward now.