4 Replies Latest reply: Mar 4, 2013 8:17 AM by 970061 RSS

    Null pointer Exception Error

    970061
      Hi All,

      i have extended CO ........ When i am compiling the code in JDEV its not giving any errors but when i am clicking on the submit button on a standard page its throwing null pointer exception error.

      public class POEXCO extends POCO
      {
      public class POEXCO()
      {
      }
      public OADBTransaction txn;
      public OracleCallableStatement callablestatement;
      String st = new String();
      public void processRequest(OAPageContext oapgecontext, OAWebBean oawebbean)
      {
      super.processRequest( oapgecontext, oawebbean);
      }
      public void processFormRequest(OAPageContext oapgecontext, OAWebBean oawebbean)
      {
      super.processRequest( oapgecontext, oawebbean);
      oapgecontext.writeDiagnostics(this,"Print",OAFwKConstants.STATEMENT);
      OAApplicationModule am = oapgecontext.getRootApplicationModule();
      OAViewobject vo = (OAViewobject)am.findViewobject("POVO");
      if(vo!=null)
      vo.first();
      oapgecontext.writeDiagnostics(this,"Print",OAFwKConstants.STATEMENT);
      Number no = (Number)vo.first().getAttribut("poheaderid");
      String string = no.toString();
      oapgecontext.writeDiagnostics(this,"Print",OAFwKConstants.STATEMENT);
      String st = "begin QAZ_WSX.launch_po_details(:1);end;";
      if(oapgecontext.getParameter("id")!=null)
      {
      oapgecontext.writeDiagnostics(this,"Print",OAFwKConstants.STATEMENT);
      callablestatement = (OracleCallableStatement)txn.createCallableStatement(st,1);
      }
      try
      {
      callablestatement.execute();
      callablestatement.setString(1,string);
      callablestatement.clsoe();
      }
      catch(SQLException ex)
      {
      throw new OAException(e.getMessage().toString(),OAException.ERROR);
      }
      }
      }

      Please see the issue where i made mistake in above code.



      Regards,
      Kalyan.