Google Analytics

Tuesday, November 3, 2015

Oracle ADF 11.1.2.4.0 AM Impl methods sometime generate unexpected null pointers .

ADF 11.1.2.4.0 AM Impl class method execution in bean should execute proper way to avoid null pointer exception
in some times (It is obvious that if you not add the method to page def first time, there is a null pointer). This behaviour not seen in 11.1.1.3.0 and 11.1.2.3.0.

Wrong code
Map results = (Map)perationBindingM.execute();

Correct code
perationBindingM.execute();
Map results = (Map)perationBindingM.getResult();

Map results = new HashMap);
try {
operationBindingM.execute();
if((!operationBindingM.getErrors().isEmpty())) {
results.put("ERROR : " + operationBindingM.getErrors());
return results;
} else {
return operationBindingM.getResult() != null ? (Map) operationBindingM.getResult() : null;
}
} catch (Exception e) {
results.put("ERROR", "Exception : "+ e.getMessage());
e.printStackTrace();
return results;
}

1 comment:

  1. By handling the execution from getResult() and getErrors() we can find the errors like "Table or View does not exist". Otherwise we get null result. If "Table or View does not exist" appear, check the table/view grants and synonyms.

    ReplyDelete