0

I am trying to edit and add job stream to the CP, but one more time I am getting "java.lang.NullPointerException" without any additional information.

List<ZosJobInfo> jobsToAdd = new ArrayList<>();
ZosJobInfo zosJobInfo = new ZosJobInfo();
zosJobInfo.setJobName("DMSORT");
zosJobInfo.setJobNumber(5);
zosJobInfo.setTimeDependent(false);
zosJobInfo.setWorkstationName("CPU1");
zosJobInfo.setWorkstationType(WorkstationType.COMPUTER);
zosJobInfo.setAutoSubmit(true);
zosJobInfo.setTaskType(TaskTypes.ZOS_JOB_TASK);
zosJobInfo.setDuration(1000L);
zosJobInfo.setCentralizedScript(false);
zosJobInfo.setParallelServer(1);
zosJobInfo.setR1(1);
zosJobInfo.setR2(1);
jobsToAdd.add(zosJobInfo);
HashMap<String, List<Integer>> dependencies = new HashMap<>();
List<Integer> jobPred = new ArrayList<>();
jobPred.add(1);
dependencies.put("5", jobPred);
DateTimeFormatter formatter2 = DateTimeFormat.forPattern("dd-MM-yyyy HH:mm z");
DateTime dateTime2 = DateTime.parse("14-05-2018 10:27 GMT",formatter2);
DateTime dlt = dateTime2.plusMinutes(1);
plan.editAddJobStreamInstanceWithVariableSubstitution(tempJobStream.getName(), dateTime2.toDate(), dlt.toDate(), 5, "EDIT ADD", "", "OWNER", "", "", null, jobsToAdd, null, null, dependencies, null, "", false,DependenciesResolutionOption.RESOLUTION_NONE, null, null);

1 Answer 1

0

Fill the "variables to be substituted" field with a void variable (it's a String[][] field). This should be sufficient to avoid null pointer exception.

2
  • I tried with: plan.editAddJobStreamInstanceWithVariableSubstitution(tempJobStream.getName(), dateTime2.toDate(), dlt.toDate(), 5, "EDIT ADD", "", "IOHXS48", "", "", null, jobsToAdd, null, null, dependencies, new String[0][0], "", false,DependenciesResolutionOption.RESOLUTION_NONE, null, null); Sill the same error.
    – moral
    May 17, 2018 at 5:39
  • The same with String[][] var = new String[1][1]; var[0][0] = ""; ... dependencies, var, "", false,.....
    – moral
    May 17, 2018 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.