cancel
Showing results for 
Search instead for 
Did you mean: 

Null pointer exception

Former Member
0 Kudos

Hi,

I have created a separate dc for my model exposed the model as public part and using the model dc as a child dc in the main dc.

Now when I create instances of the model classes it is throwing a null pointer error what may be the problem.

java.lang.NullPointerException

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModelClass.createNewBaseTypeDescriptor(AiiModelClass.java:256)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModelClass.descriptor(AiiModelClass.java:222)

at lntinfotech.com.model.Zsd_General_Parameters_01_Input.<init>(Zsd_General_Parameters_01_Input.java:51)

at lntinfotech.com.component.CreateEstiStep1Comp.asave(CreateEstiStep1Comp.java:199)

at lntinfotech.com.component.wdp.InternalCreateEstiStep1Comp.asave(InternalCreateEstiStep1Comp.java:254)

and the code wrttten in the CreateEstiStep1Comp is

Zsd_General_Parameters_01_Input inpt = new Zsd_General_Parameters_01_Input();

Ie creating the instances of the model class.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi plz some one help am getting Nullpoint Exception when i run with this code

And am getting at IWDModifiableBinaryType is deprecat Warning hope some one do help ASAP

ThanQ in Advance.

try

{

IWDAttributeInfo attributeInfo = wdContext.nodeFile().getNodeInfo().getAttribute("fileData");

IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();

byte[] fileByteArray = wdContext.currentFileElement().getFileData();

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();

com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();

IUser ep5User =WPUMFactory.getUserFactory().getEP5User(sapUser);

ResourceContext rcontext = new ResourceContext(ep5User);

RID rid = RID.getRID("/documents/MCGM Department/City Eng/");

IResourceFactory factory = ResourceFactory.getInstance();

ICollection collection = (ICollection) factory.getResource(rid,rcontext);

ByteArrayInputStream byetArrStream = new ByteArrayInputStream(fileByteArray);

Content con = new Content( byetArrStream , "application/octet-stream", -1L,"UTF-16");

IResource newResource = collection.createResource(binaryType.getFileName(), null, con);

long contentLen = newResource.getContent().getContentLength();

if (contentLen < 0)

{

}//if

else

{

wdComponentAPI.getMessageManager().reportSuccess("File uploaded is "+ binaryType.getFileName());

}//else

}//try

catch (Exception e)

{

wdComponentAPI.getMessageManager().reportSuccess ("error" + e.toString());

}

//@@end

}

Vita

Former Member
0 Kudos

Hi,

First of all.. have you deployed the DC where you have created the model and exposed the model.

If deployed, have you created two public parts API and SDA for the model.

Add this two public parts to the DC where you are using this model.

Build the DC and deploy.

Hope this helps you in resolving your problem

Regards,

Saleem