Skip to Content
0
Former Member
Nov 21, 2007 at 08:32 AM

Null pointer exception

9 Views

Hi Forum,

In the code below I am getting null pointer exception, as such my functionality is working fine but at the end of function my control goes into catch block can someone suggest me why its so.

public void additionalValidations( )

{

//@@begin additionalValidations()

boolean blnLRequiredFieldFlag=true;

boolean blnLEmailIdFlag=true;

boolean blnLEmailIdFormatFlag=true;

MessageManager msgMgr = null;

try

{

msgMgr = (MessageManager)wdThis.wdGetAPI().getComponent().getMessageManager();

blnLEmailIdFlag= wdThis.wdGetAgency_AddUserController().validateEmptyString(wdContext.currentVn_AddNewUserParametersElement().getVa_EmailAddress());

if(blnLEmailIdFlag==false)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("emailflag false"+blnLEmailIdFlag);

blnLRequiredFieldFlag=wdThis.wdGetAgency_AddUserController().validateEmptyString(wdContext.currentVn_AddNewUserParametersElement().getVa_ContactEmailId());

//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("1");

if(blnLRequiredFieldFlag==false)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("2");

msgMgr.reportMessage(IMessageAgency_AddUser.WARNING__REQUIRED_CONTACT_EMAIL_ID,null,false);

}

if(blnLRequiredFieldFlag==true)

{

//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("3");

blnLEmailIdFlag= wdThis.wdGetAgency_AddUserController().validateEmailAddress(wdContext.currentVn_AddNewUserParametersElement().getVa_ContactEmailId());

if(blnLEmailIdFlag==false)

{

//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("4");

msgMgr.reportMessage(IMessageAgency_AddUser.WARNING__IMPROPER_CONTACT_EMAIL_ID,null,false);

}

if(blnLEmailIdFlag==true)

{

//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("5");

blnLRequiredFieldFlag=wdThis.wdGetAgency_AddUserController().validateEmptyString(wdContext.currentVn_AddNewUserParametersElement().getVa_ContactPhNo());

if(blnLRequiredFieldFlag==false)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("6");

msgMgr.reportMessage(IMessageAgency_AddUser.WARNING__REQUIRED_CONTACT_PH_NO,null,false);

}

if(blnLRequiredFieldFlag==true)

{

//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("7");

wdThis.addNewUserConfirmation();

//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("7end");

}

}

}

}

if(blnLEmailIdFlag==true)

{

blnLEmailIdFormatFlag=wdThis.wdGetAgency_AddUserController().validateEmailAddress(wdContext.currentVn_AddNewUserParametersElement().getVa_EmailAddress());

if(blnLEmailIdFormatFlag==false)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("8");

msgMgr.reportMessage(IMessageAgency_AddUser.WARNING__IMPROPER_EMAIL_ID,null,false);

}

if(blnLEmailIdFormatFlag==true)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("9");

blnLRequiredFieldFlag=wdThis.wdGetAgency_AddUserController().validateEmptyString(wdContext.currentVn_AddNewUserParametersElement().getVa_ContactEmailId());

if(blnLRequiredFieldFlag==false)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("10");

msgMgr.reportMessage(IMessageAgency_AddUser.WARNING__REQUIRED_CONTACT_EMAIL_ID,null,false);

}

if(blnLRequiredFieldFlag==true)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("11");

blnLEmailIdFlag= wdThis.wdGetAgency_AddUserController().validateEmailAddress(wdContext.currentVn_AddNewUserParametersElement().getVa_ContactEmailId());

if(blnLEmailIdFlag==false)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("12");

msgMgr.reportMessage(IMessageAgency_AddUser.WARNING__IMPROPER_CONTACT_EMAIL_ID,null,false);

}

if(blnLEmailIdFlag==true)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("13");

blnLRequiredFieldFlag=wdThis.wdGetAgency_AddUserController().validateEmptyString(wdContext.currentVn_AddNewUserParametersElement().getVa_ContactPhNo());

if(blnLRequiredFieldFlag==false)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("14");

msgMgr.reportMessage(IMessageAgency_AddUser.WARNING__REQUIRED_CONTACT_PH_NO,null,false);

}

if(blnLRequiredFieldFlag==true)

{//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("15");

wdThis.addNewUserConfirmation();

}

}

}

}

}

}

catch(Exception e)

{

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Error in the method additionalvalidation, please consult the administrator"+e);

}

//@@end

}

it is also goin into this method wdThis.addNewUserConfirmation(); but its also goin to catch block.

Thanks & Regards

Jaspreet Kaur