on 08-14-2009 10:49 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.