on 12-07-2007 6:11 AM
hi,
After I run a Web Dynpro application,it shows a error as follows:
"java.lang.NullPointerException
at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClass.getAttributeValueAsInt(WSTypedModelClass.java:163)"
As in web service test, the web service runs well.But here,it can not run.I don't know what happened to my web service.Would you please give me a help?Thank you!
Hi Daniel,
Just check whether u r passing all mandatory values or not to webservice?? u can use this code for trace
public void traceWSInvocation( com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClassExecutable requestModel, java.lang.Exception ex )
{
//@@begin traceWSInvocation()
logger.traceThrowableT(
Severity.ERROR,
wdComponentAPI.getApplication().getDeployableObjectPart().getName(),
ex);
//if (logger.beDebug()) {
logger.fatalT(requestModel.wdGetRequestLog());
logger.fatalT(requestModel.wdGetResponseLog());
logger.fatalT(requestModel.associatedModelClassInfo().getModelInfo().toString());
logger.fatalT(requestModel.toString());
//}
//@@end
}
in ur execute webservice method take ur request model & make it log enabled like this
reqModel.wdSetInvocationLogEnabled(true);
in ur catch block of ur execute method, call the traceWSInvocation(request model,exception) & check the server log. send the trace from server log.
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1:This Exception will be caused if you pass null values to the webservice
First surround the statements in try.. catch blocks and trace your application by printing values that you pass to Webservice in try block.. by giving
wdComponentAPI.getMessageManager.reportSuccess("Valu1= "+<Value1>);
try{
statement1;
statement2; etc..
}catch(Exception e)
{
wdComponentAPI.getMessageManager.reportException("Exception while testing "+e,false);
return;
}
2:This Exception can also be caused because of not initialization takes place in wdDoInit() method
in wdDoinit() method put these
<Request_testData> obj=new <Request_testData>();
wdContext.node<Request Node>().bind(obj);
Regards
LakshmiNarayana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.