Null Pointer Exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bansalrichaacc
    New Member
    • Jul 2007
    • 1

    #1

    Null Pointer Exception

    In The Following Code I am Getting Null Pointer Exception

    try{
    ClientBean[] clientInfo = clientManager.g etClientList();

    System.out.prin tln("richa2"+cl ientInfo);

    if (clientInfo != null ) {
    form.setClientI nfo(clientInfo) ;
    // form.getClientI nfo();
    System.out.prin tln("if");

    //System.out.prin tln("form.getCl ientInfo() "+form.getClien tInfo());

    System.out.prin tln("set all info's");
    forward = findMapping(con text, "success");
    System.out.prin tln("After success");
    } else
    { System.out.prin tln("else");
    // message = "AutoCostingInt erfaceDisplayAc tion" ;
    //context.setAttr ibute("message" , message);
    System.out.prin tln("going in failure page");
    //forward = findMapping(con text, "failure");
    }
    }catch(Exceptio n ex){
    System.out.prin tln("inside catch"+ex);
    }

    return forward;
    }


    Can you help me regarding this ?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by bansalrichaacc
    In The Following Code I am Getting Null Pointer Exception

    try{
    ClientBean[] clientInfo = clientManager.g etClientList();

    System.out.prin tln("richa2"+cl ientInfo);

    if (clientInfo != null ) {
    form.setClientI nfo(clientInfo) ;
    // form.getClientI nfo();
    System.out.prin tln("if");

    //System.out.prin tln("form.getCl ientInfo() "+form.getClien tInfo());

    System.out.prin tln("set all info's");
    forward = findMapping(con text, "success");
    System.out.prin tln("After success");
    } else
    { System.out.prin tln("else");
    // message = "AutoCostingInt erfaceDisplayAc tion" ;
    //context.setAttr ibute("message" , message);
    System.out.prin tln("going in failure page");
    //forward = findMapping(con text, "failure");
    }
    }catch(Exceptio n ex){
    System.out.prin tln("inside catch"+ex);
    }

    return forward;
    }


    Can you help me regarding this ?
    The exception trace also tells you the exact line number that threw that exception. Which line does it say?

    Comment

    Working...