-
Sep 30th, 2010, 11:36 AM
#1
#{jobParameters[' ']} on AIX Unix
I have a job running fine when executed with CommandLineJobRunner on Windows. When I move this same job to an AIX platform and attempt to execute it through the CommandLineJobRunner, the jobParameters are not parsed correctly.
Below is my step definition. I've printed out the values from within the ConvertRasmToPDF class when executing on AIX and the values for these properties are sent in as text. So parmEvent equals the String #{jobParameters['event']} within the program.
Do I need to modify this step syntax when moving to AIX to have these parsed into their correct values instead of being taken as Strings??
<bean id="processTasklet" scope="step"
class="com.aa.ta.rasmpdf.ConvertRasmToPDF">
<property name="parmEvent" value="#{jobParameters['event']}" />
<property name="parmFileType" value="#{jobParameters['fileType']}" />
<property name="parmFileName" value="#{jobParameters['fileName']}" />
<property name="parmSite" value="#{jobParameters['site']}" />
<property name="parmComp" value="#{jobParameters['comp']}" />
<property name="parmFund" value="#{jobParameters['fund']}" />
<property name="parmReportNbr" value="#{jobParameters['reportNbr']}" />
</bean>
-
Oct 3rd, 2010, 08:24 AM
#2
Java (and Spring Batch) is not going to behave differently on AIX (hopefully). Most likely you are starting the job in a different way? Maybe the shell is different,and you need to escape something. I'm not really sure what you mean by "sent in as text" (all command line arguments are text), and it's not clear what you want it to be, but Spring will convert text to simple primitive types out of the box, so why would that be a problem? Maybe you could share the details of how you launch the job and/or look at the DefaultJobParametersConverter that is used in CommandLineJobRunner (and the javadocs for the runner) to see how the command line args are parsed into JobParameters?
-
Oct 3rd, 2010, 02:33 PM
#3
clarification
what I meant by sent in as text is that when I specify this in the job xml:
<property name="parmEvent" value="#{jobParameters['event']}" />
Then in my program in the setParmEvent() method I get the value
#{jobParameters['event']}
So for some reason this String in the XML is not replaced by the actual value of the variable. We are executing this job in a korn script.
I know the parameters are passed correctly because in my Tasklet program I can access the parameters programmatically. So this code provides the actual value I am looking for:
public class ConvertRasmToPDF implements Tasklet {
public RepeatStatus execute(StepContribution arg0, ChunkContext context)
throws Exception {
// collect job parameters
this.setParmEventObj(context.getStepContext().getJ obParameters().get("event"));
. . .
}
Unfortunately this is not the ideal situation since I would have to write custom readers for all jobs instead of taking advantage of some of the provided readers such as the FlatFileItemReader.
I haven't found any documentation discussing how to influence the #{jobParameters[]} syntax though. Perhaps on AIX or in the Korn scripts the # is interfering.
-
Oct 3rd, 2010, 07:15 PM
#4
I see what you meant originally about the text value, but it still doesn't make a lot of sense. I don't see how the OS or shell can change your configuration at runtime. Are you sure the classpath is the same in both cases?
-
Oct 3rd, 2010, 07:30 PM
#5
classpath
Yeah, I've validated and actually hard coded the classpath in the job to ensure it is the same. The only difference is it works running on Windows and does not on AIX.
-
Oct 3rd, 2010, 09:11 PM
#6
So the command line must be different. What's in your ksh script?
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