Skip to Content
avatar image
Former Member

java.lang.NullPointerException

Hi all,

java.lang.NullPointerException

at com.sap.sh.SHView.wdDoInit(SHView.java:101)

at com.sap.sh.wdp.InternalSHView.wdDoInit(InternalSHView.java:153)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)

at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)

at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)

... 32 more

What i missing in this code...

IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateSHView.IJobsElement.JOB);

<b>ISimpleTypeModifiable countryType = attributeInfo.getModifiableSimpleType();</b>(101)

// Set field label and populate valueset

countryType.setFieldLabel("Country");

IModifiableSimpleValueSet valueSet = countryType.getSVServices().getModifiableSimpleValueSet();

for (int i = 0; i < wdContext.nodeJobs_input().size(); i++)

{

valueSet.put(wdContext.nodeJobs_input().getJobs_inputElementAt(i),"cons"+i);

}

Plz Tel me

Thanks & Regards

Mathi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jun 07, 2007 at 09:44 AM

    Hi Mathi,

    The reason is you are trying to access a node which has no elements.

    Check the nodes for elements before accessing it.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2007 at 09:46 AM

    Is there a node Jobs containing a value attribute "job".

    Seems it cant find that attribute.. ! Check some spellin mistake.. !

    Regards

    Bharathwaj

    PS :@ Satish : Thats incorrect. For accessing attribute info you just need the attribute.

    Message was edited by:

    Bharathwaj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2007 at 09:48 AM

    Hi,

    Please create element of your node called JobsElement first.

    wdContext.nodeJobsElement.addElement(wdContext.nodeJobsElement.createElement);

    in the wdIinit of your component controller and then again run and deploy it

    Thanks and Regards

    Avijit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2007 at 09:53 AM

    Hi,

    It couldn´t find the attibute, therefore attributeInfo is null.

    Can you try somethin like

    wdContext.currentJobsElementElement.getAttribute(`JOB`)

    Good luck, Roelof

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2007 at 10:29 AM

    Hi,

    Instead of

    IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateSHView.IJobsElement.JOB);

    use

    IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("job");

    and then try

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      after putting the code in the Controller populate method, I am still getting this error <<i>Parse method is not possible for this type</i>>

      here is my populate method...

       public void Populate( )
        {
          //@@begin Populate()
      	IWDAttributeInfo attInfo1 = wdContext.nodeSubmitElements().getNodeInfo().getAttribute(IPrivateDemurrageSubmit.ISubmitElementsElement.INVOICE_DOC);
      		attInfo1.getModifiableSimpleType();
      		IWDAttributeInfo attInfo2 = wdContext.nodeSubmitElements().getNodeInfo().getAttribute(IPrivateDemurrageSubmit.ISubmitElementsElement.SECOND_INVOICE_DOC);
      		attInfo2.getModifiableSimpleType();	
          //@@end
        }