Skip to Content
author's profile photo Former Member
Former Member

Migrating to BI 4 - DocumentInstance.getPrompts() throws Exception

We are currently migrating to BI 4. The following lines of code:

            IWebi document = (IWebi) report;            ReportEngines reportEngines = null;            ReportEngine reportEngine = null;            DocumentInstance documentInstance = null;            try {                      reportEngines = (ReportEngines) session.getService("ReportEngines");                      reportEngine = reportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);                      documentInstance = reportEngine.openDocument(document.getID());                      Prompts prompts = documentInstance.getPrompts(); //this method throws exception below...

throws following exception:

com.businessobjects.sdk.core.server.CommunicationException$UnexpectedServerException: Unable to create an instance of class 'interface com.businessobjects.sdk.core.server.IServerCommand' with qualifier 'com.sap.sl.sdk.requests.GetPromptListRequest'          at com.businessobjects.sdk.core.exception.ExceptionBuilder.make(ExceptionBuilder.java:144)          at com.businessobjects.sdk.core.exception.ExceptionBuilder.make(ExceptionBuilder.java:101)          at com.businessobjects.sdk.core.server.internal.AbstractServer.processIt(AbstractServer.java:183)          at com.businessobjects.sdk.core.server.internal.AbstractServer.process(AbstractServer.java:133)          at com.businessobjects.sdk.core.server.internal.InstanceServer.process(InstanceServer.java:94)          at com.sap.sl.sdk.services.util.ServerRequestProcessor.processServerRequest(ServerRequestProcessor.java:49)          at com.sap.sl.sdk.workspace.service.WorkspaceServiceImpl.getParametersList(WorkspaceServiceImpl.java:385)          at com.businessobjects.rebean.wi.internal.WIDocumentInstance.getParameters(WIDocumentInstance.java:1088)          at com.businessobjects.rebean.wi.internal.WIDocumentInstance.getPrompts(WIDocumentInstance.java:316)          at com.volvo.itbe.bit.burstingapi.prompts.ReportPrompts.setReportPrompts(ReportPrompts.java:42)          at com.volvo.itbe.bit.burstingapi.scheduler.ReportScheduler.execute(ReportScheduler.java:109)          at com.volvo.itbe.bit.rgds.reportGenerator.ReportGenerator.generateReport(ReportGenerator.java:118)          at com.volvo.itbe.bit.rgds.reportGenerator.WebIReportGenerator.main(WebIReportGenerator.java:42)Caused by: com.businessobjects.sdk.core.CoreException: Unable to create an instance of class 'interface com.businessobjects.sdk.core.server.IServerCommand' with qualifier 'com.sap.sl.sdk.requests.GetPromptListRequest'          at com.businessobjects.sdk.core.internal.guice.GenericFactory.create(GenericFactory.java:115)          at com.businessobjects.sdk.core.Core.create(Core.java:521)          at com.businessobjects.sdk.core.server.internal.corba.CorbaServerImpl.doProcess(CorbaServerImpl.java:78)          at com.businessobjects.sdk.core.server.internal.AbstractServer.processIt(AbstractServer.java:171)          ... 10 moreCaused by: com.google.inject.ConfigurationException: Missing binding to com.businessobjects.sdk.core.server.IServerCommand annotated with @com.google.inject.name.Named(value=com.sap.sl.sdk.requests.GetPromptListRequest).          at com.google.inject.InjectorImpl.getProvider(InjectorImpl.java:696)          at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:724)          at com.businessobjects.sdk.core.internal.guice.GenericFactory.create(GenericFactory.java:113)          ... 13 more

We have included ALL BI4 java lib jars (which, btw, seems more like a quick and dirty solution) as documented in the user guide.

Please tell us what we are missing?

Cheers,

M.

PS. using BI4 SP4

=== EDIT ===

We managed to identify all required rebean libraries and this error is now resolved.

However, we are still experiencing OSGI dependency conflicts with IBM Websphere v7.5.

Br,

Marc.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 06, 2013 at 04:58 PM

    Hi Marc,

    I am also facing the same issue, can you please name required rebean libraries?

    Thanks,

    Ashok

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2013 at 12:15 PM

    Hello Marc,

    The code that you use to open document and get prompts doesn't work in BI 4 more.

    I use the following code to get document parameters.

    final IDocumentInstance documentInstance = ServicesHelper.getDocumentInstanceManagementService().openDocument(

    globalContext, documentID);

    final Workspace workspace = ServiceProvider.getDocumentInstanceService().getWorkspace(globalContext,

    documentInstance);

    final WorkspaceService workspaceService =Core.getService(WorkspaceContextualService.class, globalContext);

    workspaceService.getDataProviders(workspace);

    workspaceService.prepare(workspace);

    final ParameterService parameterService = (ParameterService) Core.getService(ParameterContextualService.class, globalContext);

    final List<Parameter> parameters = parameterService.getNeededParameters(workspace);

    for (final Parameter promptParameter : promptParameters)

    {

    ...

    }

    Thanks,

    Victor

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Mark,

      Sorry for delay.

      I can suggest you the following code example.

      private static final Locale DEFAULT_LOCALE = Locale.getDefault();

      private final LocaleFormattings localeFormattings = new LocaleFormattings(DEFAULT_LOCALE);

      public List<String> getParameterValues(final IContext globalContext, final int id, final String parameterName)

      throws SDKException

      {

      if (StringUtils.isBlank(parameterName))

      {

      return null;

      }

      final IDocumentInstance documentInstance = ServicesHelper.getDocumentInstanceManagementService().openDocument(

      globalContext, id);

      final Workspace workspace = ServiceProvider.getDocumentInstanceService().getWorkspace(globalContext,

      documentInstance);

      boServiceHelper.getWorkspaceService(globalContext).prepare(workspace);

      final List<Parameter> parameters = ((ParameterService) Core.getService(ParameterContextualService.class, globalContext)).getNeededParameters(

      workspace);

      for (final Parameter parameter : parameters)

      {

      if (parameterName.equals(parameter.getIdentifier()))

      {

      final AnswerInformation answerInformation = parameter.getAnswerInformation();

      final DataType dataType = answerInformation.getDataType();

      final SelectionType selectionType = answerInformation.getSelectionType();

      final List<String> result = new ArrayList<String>();

      if (selectionType.equals(SelectionType.SINGLE_VALUE))

      {

      final SingleValueAnswer answer = (SingleValueAnswer) answerInformation.getPreviousAnswer();

      final String value = formatField(answer.getAnswerValue().getCaptionField(),

      dataType);

      result.add(value);

      }

      else if (selectionType.equals(SelectionType.MULTI_VALUE))

      {

      final MultiValueAnswer answer = (MultiValueAnswer) answerInformation.getPreviousAnswer();

      for (final AnswerValue answerValue : answer.getAnswerValues())

      {

      final String value = formatField(answerValue.getCaptionField(), dataType);

      result.add(value);

      }

      }

      return result;

      }

      }

      return null;

      }

      public String formatField(final Field field, final DataType dataType)

      {

      String result = "";

      if (field != null)

      {

      final FieldType fieldType = field.getType();

      if (FieldType.DATE.equals(fieldType))

      {

      final Date date = field.getDate();

      if (date != null)

      {

      result = dataType == DataType.DATE_TIME ? getDateTimeFormat(DEFAULT_LOCALE).format(date)

      : getDateFormat(DEFAULT_LOCALE).format(date);

      }

      }

      else if (FieldType.DOUBLE.equals(fieldType))

      {

      final Double d = field.getDouble();

      if (d != null)

      {

      result = localeFormattings.formatDouble(d);

      }

      }

      else if (FieldType.STRING.equals(fieldType))

      {

      result = field.getString();

      }

      }

      return result;

      }

      -Victor

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 09:09 AM

    Hi Marc,

    You can use the below code to create a web-i Service in 4.0

    ReportEngine reportEngine = (ReportEngine)session.getService("", "WebiReportEngine");

    infoStore = (IInfoStore)ession.getService("InfoStore");

    This worked in our environment.

    -Cimbu

    Add a comment
    10|10000 characters needed characters exceeded

    • Some, but not all, of the things you used to be able to do with ReportEngine are now available through the RESTful Web Services. The cool thing about this SDK is that it doesn't require any BO-specific library files, so upgrading to a new version should be fairly easy (as in, no code changes or recompile required...) I have worked with one client who has successfully replaced their old ReportEngine code with this to get the parameters for Webi Reports so that they can build an OpenDocument URL to view the report with the parameters set.

      -Dell

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.