Unexpected Null pointer exception in Oracle ADF

Recently I faced an issue in Adf application. The .jspx page giving null pointer exception after doing some operation in page. And every variable have contain their value. I have try to run application many time in debug mode to replicate the problem but not able to find. Then I find in ADF application when ever You make any Input or Output text in jspx. page it automatically make validator. af:validator is automatically generated when you create a form component. You can check that validator by clicking the Source button. Solution of the problem is – to comment the validator part in xml part.
You will find error in ADF class like this.

java.lang.NullPointerException
at oracle.jbo.uicli.binding.JUCtrlValueBinding.validateAttributeValue(JUCtrlValueBinding.java:757)

For Solution you should go to seach option and Search for af:validator in full application.Where you can find this tag. Make it comment like example I have given below.

null1

After applying the solution application doesn’t give Null pointer exception

Autoboxing In java

Automatic conversion of primitive types and their corresponding object wrapper classes (eg, int and Integer, double and Double, etc).
Autoboxing is a new feature java 1.5 . It is a capability to convert or cast between object wrapper and it’s primitive type.it was necessary to wrap a primitive type to a Wrapper class before adding it to a collection i.e is called Boxing and to unwrap it back to the primitive when it came out of the collection i.e unboxing.

Auto-boxing and Auto-Unboxing enables the primitive types to be converted into respective wrapper objects and the other way around.
Before jdk 1.5 we need to manual boxing.We have to write tedious coding for that.

example-
Integer vinay();

int i = vinay();

Difference between autoboxing and Casting

Boxing – Boxing is when you use or make primitive type to a reference type
Casting – Casting is when you want one type to treated as another type, between primitive types and reference types

Procedure calling in Oracle ADF

In Oracle Adf we will doing DML operation by calling the Procedure.Here the syntax of calling
Stored procedure is as follow:

Here Procedure name is --  Vinayprocedure(empno,job,name)

StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("Vinayprocedure");
call.addUnamedArgument("empno");
call.addUnamedInOutputArgument("job", "job", String.class);
call.addUnamedOutputArgument("name");

DataModifyQuery query = new DataModifyQuery();
query.setCall(call);
query.addArgument("empno");
query.addArgument("job");
query.addArgument("name");

session.addQuery("Vinayprocedure ", query);

Vector parameters = new Vector();
parameters.addElement(new Integer(7369));
parameters.addElement("engineer");
parameters.addElement("Vinay");
Object data = session.executeQuery(query, parameters);

When we are calling data from some view object, we can use this code  :-
VinayViewObject1Iterator= view object iterator.

StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("Vinayprocedure2");
call.addNamedArgument("empno");
call.addNamedArgument("job");
call.addNamedArgument("name");

DataModifyQuery query = new DataModifyQuery();
query.setCall(call);
query.addArgument("empno");
query.addArgument("job");
query.addArgument("name");
Vector parameters = new Vector();

DCIteratorBinding iteratorobject= findIterator("VinayViewObject1Iterator");
RowSetIterator rowObject = iteratorobject.getRowSetIterator();
rowObject.setRangeSize(rowObject.getRowCount());
RowKeySet keysetobject = this.getTable().getSelectionState();
Set keySetobject = keysetobject.getKeySet();
Iterator itrobject = keysetobject.iterator();

while (itrobject.hasNext()) {
Integer intr = (Integer)itr.next();
VinayViewObjectRowImpl row =
(VinayViewObjectRowImpl)keysetobject.getRowAtRangeIndex(intr.intValue());
parameters.addElement(row.getAttribute(“empno));                       parameters.addElement(row.getAttribute(“job”));
parameters.addElement(row.getAttribute(“name”));

session.addQuery("Vinayprocedure2", query);
Object data = session.executeQuery(query, parameters);

parameters.clear();