cancel
Showing results for 
Search instead for 
Did you mean: 

Nullpointer found in view when using WebService: ReportEngine

Former Member
0 Kudos

Hi,

I am currently using Business Objects WebService SDK (Java) to develop some applications, but I encountered some problems on viewing the report.

Following the samples provided by the WebService SDK Libraries

(https://boc.sdn.sap.com/node/18390), I successfully created and

executed a query create a document from a built-in universe, e-Fashion, that gives view of the report (i.e. create a document reference from QueryService and load the view from the document using ReportEngine).However, when I was doing the same in my working universe, it appears an error.

I have found that no views had been set for the document created by the QueryService(i.e. DocumentInformation.isSetView() = false) and get a nullpointer exception when trying to view the report (i.e. DocumentInformation.getView() ) . I also found that there are some MustFillPrompts existing in the document (i.e.DocumentInformation.MustFillPrompts() = true). I suspect it is the clause that the view cannot be shown but I have no clues to fix it due to not enough samples available.

Some Additional information:

I can create and save a Webi report in my working universe, and

optional prompts appear when I was creating the report.

With the Webi report created in the BOE server, I can view the Document from the WebService SDK successfully using ReportEngine (using report id), and here are my findings for the document opened in this sense:

DocumentInformation.isSetView() = true

DocumentInformation.MustFillPrompts() = false

Any help would be greatly appreciated.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Aasavari,

Thanks for your concerns.

I have solved the nullpointer problem already with the use of FillPrompts (I didn't use it before).

However, it raises another question:

How to set null values to the optional prompts?

By using QueryService, I am building a query from a universe, which originally contains some optional prompts, and the service eventually returns a document reference string that it will be further used in ReportEngine. When I open the created report with

boRepEng.getDocumentInformation(strBODocUID,fillInfo,actions,null,boRetrieveData);

the program shows that the report contains some MustFillPrompts, referring to those optional prompts preset by the universe. However, those prompts are not essential for my report and I try to fill those prompts as null. Here is the coding:


 FillPrompts boPrompts = FillPrompts.Factory.newInstance();
 FillPrompt[] fillPromptList = new FillPrompt[1];
 fillPromptList[0] = FillPrompt.Factory.newInstance();
 fillPromptList[0].setID(RPTPrompt[0].getID());

 {
		DiscretePromptValue[] dpv = new DiscretePromptValue[1];
		dpv[0] = DiscretePromptValue.Factory.newInstance();
		dpv[0].setNilValue() ;
		fillPromptList[0].setValuesArray(dpv);
 }
			 
 boPrompts.setFillPromptListArray(fillPromptList);
 Action[] actions1 = new Action[1];
 actions1[0] = boPrompts;
			 
 RetrieveMustFillInfo fillInfo = RetrieveMustFillInfo.Factory.newInstance();
 RetrievePromptsInfo promptInfo = RetrievePromptsInfo.Factory.newInstance();
 fillInfo.setRetrievePromptsInfo(promptInfo);

 DocumentInformation boDocInfo = objReportEngine.getDocumentInformation(boQueryDocRef,fillInfo, actions1, null, retBOData);

but it appears an error:


org.apache.jasper.JasperException: Exception in JSP: /Sample_prompt.jsp:499

496: 			 RetrievePromptsInfo promptInfo = RetrievePromptsInfo.Factory.newInstance();
497: 			 fillInfo.setRetrievePromptsInfo(promptInfo);
498: 
499: 			 DocumentInformation boDocInfo = objReportEngine.getDocumentInformation(boQueryDocRef,fillInfo, actions1, null, retBOData);
500: 			 out.println("<br>");
501: 			 out.println("MustFillPrompts = " + boDocInfo.getMustFillPrompts() + "<br>");
502: 			 out.println("isSetView() = "+ boDocInfo.isSetView()+"<br>"); 


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:361)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

org.apache.axis2.AxisFault: The prompt 'Country' contains an invalid numeric value. (WIS 10705)
	org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
	org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
	org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
	org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
	org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
	com.businessobjects.dsws.reportengine.ReportEngine.getDocumentInformation(Unknown Source)
	org.apache.jsp.Sample_005fprompt_jsp._jspService(Sample_005fprompt_jsp.java:596)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

However, the program runs fine when I replace the code dpv[0].setNilValue() to dpv[0].setValue("5").

Any clues for me to set up the codes ?

Thanks

Regards,

Gary

aasavaribhave
Advisor
Advisor
0 Kudos

Hi,

can you check in your code at the line where you cann getDocumentInformation():

DocumentInformation boDocInfo = boRepEng.getDocumentInformation(strBODocUID,fillInfo,actions,null,null);

Is the 5th parameter null (as above)? The 5th parameter is RetrieveData object and you may need to pass a valid RetriveDataobject instead of null which will return DocumentInformation.MustFillPrompts() = true if webi has prompts.