Java exception: IServer & qualifier cms.oca

Hello,

I 'm trying to migrate to SDK4.2.
I’ve an issue when I try to do :

 engine.openDocument(infoObject.getID()) 

The exception is :


com.businessobjects.sdk.core.CoreException: Unable to create an instance of class 'interface com.businessobjects.sdk.core.server.IServer' with qualifier 'cms.occa'
                at com.businessobjects.sdk.core.internal.guice.GenericFactory.create(GenericFactory.java:115)
                at com.businessobjects.sdk.core.Core.create(Core.java:520)
                at com.businessobjects.sdk.core.server.internal.InstanceServerServiceImpl.createServer(InstanceServerServiceImpl.java:67)
                at com.businessobjects.rebean.wi.impl.services.DocumentInstanceManagementServiceImpl.createServerCallerReader(DocumentInstanceManagementServiceImpl.java:854)
                at com.businessobjects.rebean.wi.impl.services.DocumentInstanceManagementServiceImpl.openDocument(DocumentInstanceManagementServiceImpl.java:173)
                at com.businessobjects.rebean.wi.impl.services.DocumentInstanceManagementServiceImpl.openDocument(DocumentInstanceManagementServiceImpl.java:82)
                at com.businessobjects.rebean.wi.internal.WIReportEngine.openDocument(WIReportEngine.java:429)
                at com.businessobjects.rebean.wi.internal.WIReportEngine.openDocument(WIReportEngine.java:438)
                at com.lombard.reportengine.businessobjects.impl.BODocumentCreator.executeSpecificReport(BODocumentCreator.java:85)
                at com.lombard.reportengine.connector.impl.BusinessObjectsConnector.createReport(BusinessObjectsConnector.java:147)
                at com.lombard.reportengine.connector.impl.ReportProviderConnectorFactory.getIReportProviderConnector(ReportProviderConnectorFactory.java:117)
                at com.lombard.reportengine.services.impl.ReportEngineStartupServiceImpl$1.call(ReportEngineStartupServiceImpl.java:87)
                at com.lombard.reportengine.services.impl.ReportEngineStartupServiceImpl$1.call(ReportEngineStartupServiceImpl.java:67)
                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
                at java.util.concurrent.FutureTask.run(FutureTask.java:138)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
                at java.lang.Thread.run(Thread.java:662)
Caused by: com.google.inject.ConfigurationException: Missing binding to com.businessobjects.sdk.core.server.IServer annotated with @com.google.inject.name.Named(value=cms.occa).
                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)

My code:


 
        logger.info("Starting creation of document " + infoObject.getTitle());
        try {
            final ReportEngine engine = (ReportEngine) session.getService("", "WebiReportEngine");
            logger.debug("WebiReportEngine service " + engine.getVersion() + " available.");
 
           final DocumentInstance doc = engine.openDocument(infoObject.getID());
 
            doc.refresh();
 
            // setting report input parameters
            final Prompts prompts = doc.getPrompts();
            if (prompts != null && prompts.getCount() > 0) {
                BOPromptsSetter promptsSetter = new BOPromptsSetter();
                promptsSetter.setPrompts(prompts, userInputParameters);
            }
 
            // now activate previously set input parameters
            boolean reportOk = setDocumentInstancePrompts(doc);
 
...
 

.

If anyone have an idea or a solution, it is more than welcome.

Thanks.


codemewithfun (BOB member since 2017-02-15)

REBean is mostly deprecated in BI4. You might be able to get it to work by including a boatload of additional jars, but no guarantees. See this thread.

Joe


joepeters :us: (BOB member since 2002-08-29)

The vast majority of REBean has been deprecated and replaced by functionality in the RESTful Web Services SDK. The good thing about this new SDK is that you don’t have to install any SDK on your development workstation. You just have to have a way to make HTTP GET and POST requests from your code. You can also specify whether you want it to communicate with either XML or JSON.

The bad thing is that you’re going to have to re-write your old code to use it.

What were you trying to do in your original code?

-Dell


hilfy :us: (BOB member since 2007-04-16)

Even though the biggest part of the old SDK is deprecated, I believe openDocument() should work as well as the document refresh workflow. Could you try the following code:


ReportEngines reportEngines = (ReportEngines) session.getService("ReportEngines");
ReportEngine engine = (ReportEngine) reportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);

instead of


final ReportEngine engine = (ReportEngine) session.getService("", "WebiReportEngine"); 

Dmytro Bukhantsov :norway: (BOB member since 2011-10-14)

OpenDocument does work - the url has changed from 3.1, though.

SAP is really pushing the RESTful Web Services for this. More functionality is added with every service pack and they have stated that, at some point in the future, this will be the only SDK available.

-Dell


hilfy :us: (BOB member since 2007-04-16)

That will be a sad, sad day.


joepeters :us: (BOB member since 2002-08-29)