on 11-20-2008 2:01 PM
Hi guys,
I have a Web Dynpro project which uses an adaptive web service model to query/modify data. Today I updated the service to return a list instead of a string. Then I got the problem after reimported the model. I got a NullPointerException when binding the model to the context. My data structure is as below:
Request_ImportRelationships (0..n)
ImportRelationshipList (0..1)
ImportRelationship (0..n)
DelegatorId
DelegatorId
ImportResponse (0..1)
ImportResultList (0..1)
ImportResult (0..n)
Relationship (1..1)
DelegatorId
Tenant
Message
The error I got was:
java.lang.NullPointerException
at com.sap.tc.webdynpro.model.webservice.base.model.BaseGenericModelClass.retrieveTargetRoleInfo(BaseGenericModelClass.java:91)
at com.sap.tc.webdynpro.model.webservice.base.model.BaseGenericModelClass.setRelatedModelObject(BaseGenericModelClass.java:344)
at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClass.setRelatedModelObject(WSTypedModelClass.java:69)
The code in my wdDoInit() method is:
CCTenantModel model = new CCTenantModel();
importRequest = new Request_ImportRelationships(model);
Response_ImportRelationships importResponse = new Response_ImportRelationships(
model);
TenantRelationshipList tenantRelationshipListToImport = new TenantRelationshipList(
model);
TenantRelationship tenantRelationshipToImport = new TenantRelationship(
model);
List<TenantRelationship> tenantList = new ArrayList<TenantRelationship>();
tenantList.add(tenantRelationshipToImport);
tenantRelationshipListToImport.setTenantRelationship(tenantList);
importRequest.setRelationshipList(tenantRelationshipListToImport);
TenantImportResultList importResultList = new TenantImportResultList(model);
TenantImportResult importResult = new TenantImportResult(model);
TenantRelationship relationshipResult = new TenantRelationship(model);
List<TenantImportResult> list = new ArrayList<TenantImportResult>();
list.add(importResult);
importResult.setRelationship(relationshipResult);
importResultList.setImportResult(list);
importResponse.setImportResultList(importResultList);
importRequest.setResponse(importResponse);
wdContext.nodeRequest_ImportRelationships().bind(importRequest);
Can anybody point out what is the problem of the binding here? I could find some examples from the forum but they are a bit different since there are several levels in my app.
Thanks very much!
James
Hello James,
You can use "Invalidate of ARFC Metadata Cache" tool in webdynpro console instead of restarting the server.
Here you can invalidate the metadata cache after reimporting the model.
Best Regards,
Pankaj Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
James,
you need to restart the server after the reimporting process.
i think that's the problem
regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
in the ws navigator provide the input or values to the webservices and execute the webservce
and try to hard code the same values and check . or there may be problem with the
structure node initialization and setting .
There would be classes generated for the structured Nodes for your service and you can find all the
classes in the data modeler on edit on data link from model to controller .
initialization those classes and set the attributes and model according with comparing to the
Webservice structure in the Wsnavigator . this would help you .
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, i think this null pointer will come in the so many scenarios, but my guess is when your getting the values from model or passing tyhe value to the model its giving this null pointer, may be,
check for the data in the backend are check with all message is there any field is null,]
it better check with use of IF condition before getting or setting the value,
it may help you my friend,
Cheers.
Apparao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
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.