Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

java.lang.NullPointerException

Hi All,

I get a null pointer exception when trying to run my web dynpro app, here are the details:

java.lang.NullPointerException

at com.sap.tc.webdynpro.progmodel.context.MappedNodeElement.wdGetObject(MappedNodeElement.java:350)

at com.sap.tc.webdynpro.progmodel.context.NodeElement.getAttributeAsText(NodeElement.java:888)

Here is the code in component controller

public void wdDoInit()
  {
    //@@begin wdDoInit()

    subjAreaInput = new Zep_Get_Infoprovider_Status_Input();	
    wdContext.nodeZep_Get_Infoprovider_Status_Input().bind(subjAreaInput);
           
    executeSubjAreaInput();
      
    
    //@@end
  }

public void executeSubjAreaInput( )
  {
    //@@begin executeSubjAreaInput()
    try
    {
	subjAreaInput.execute();
	wdContext.nodeOutputSubjArea().invalidate();
    }
    catch(Exception e)
    {
	e.printStackTrace();
    }
    //@@end
  }

Here is the line where the code fails:

public void setDescriptions( )
  {
    //@@begin setDescriptions()
    int elemCount = wdContext.nodeZep_Ent_Subj_Status().size();
    if( elemCount > 0 ) //elemCount is 7, I have verified this
    {
	for( int i=0; i<elemCount; i++)
	{
             // code fails at this line with the above exception
	String compare = wdContext.nodeZep_Ent_Subj_Status().getElementAt(i).getAttributeAsText("SUBJECT_AREA");
                }
    }
  }

Please help!! I've been trying to debug for 2 days now!!

Thanks

TM

Not what you were looking for? View more on this topic or Ask a question