Below is the part of code:
-----------------------------------------------------
ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = sessionMgr.logon(userName, password,cms, auth);
reportEngines = (ReportEngines) enterpriseSession.getService("ReportEngines");
ReportEngine wiRepEngine = (ReportEngine) reportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
String query = "select SI_NAME, SI_ID from CI_INFOOBJECTS where SI_KIND = 'Webi' and SI_INSTANCE=0";
IInfoObjects infoObjects = (IInfoObjects) infoStore.query(query);
for (Object object : infoObjects) {
IInfoObject infoObject = (IInfoObject) object;
String path = getInfoObjectPathAndTitle(infoObject);
if (path.startsWith("/Test")) {
DocumentInstance widoc = wiRepEngine.openDocument(infoObject.getID());
-----------------------------------------------------------
When it reaches the line:
DocumentInstance widoc = wiRepEngine.openDocument(infoObject.getID());
It throws below error:
Exception in thread "main" com.businessobjects.rebean.wi.ServerException: session is closed.
at com.businessobjects.rebean.wi.REFactory.createSimpleServerException(Unknown Source)
at com.businessobjects.wp.om.OMFactory.createServerException(Unknown Source)
at com.businessobjects.rebean.occa.OccaReportEngineComAdapter.documentLoadingError(Unknown Source)
at com.businessobjects.rebean.occa.OccaReportEngineComAdapter.createCadenzaSession(Unknown Source)
at com.businessobjects.rebean.occa.OccaReportEngineComAdapter.initNewCadenzaSession(Unknown Source)
at com.businessobjects.rebean.occa.OccaReportEngineComAdapter.openDocument(Unknown Source)
at com.businessobjects.rebean.wi.ReportEngineImpl.openDocument(Unknown Source)
at com.businessobjects.rebean.wi.occa.WebiReportEngine.openDocument(Unknown Source)
at com.ubs.bims.businessobjects.xi.tools.UpdateUBSLogo.main(UpdateLogo.java:62)
I am and stuck here. Kindly help.