cancel
Showing results for 
Search instead for 
Did you mean: 

Exception at wiRepEngine.openDocument(infoObject.getID());

Former Member
0 Kudos

Hi Guys,

It’s been almost a year and half I worked on BOBJ. My Java program used to work fine! But now when I try to run a simple program I am getting an exception at

DocumentInstance widoc = wiRepEngine.openDocument(infoObject.getID());

Exception:

  1. Connecting...

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 org.user.javatool.Test.main(Test.java:39)

Please let me know if i am missing anything?

used libraries:

  •   boconfig.jar
  •   cecore.jar
  •   celib.jar
  •   cesdk.jar
  •   cesession.jar
  •   corbaidl.jar
  •   ebus405.jar
  •   jtools.jar
  •   logging.jar
  •   rebean.common.jar
  •   rebean.jar
  •   rebean.wi.jar
  •   wilog.jar
  •   xpp3.jar
  •   xpp3_min.jar
  •   SL_plugins.jar

Below is my simple test program

package org.user.javatool;

import com.businessobjects.rebean.wi.DocumentInstance;

import com.businessobjects.rebean.wi.ReportDictionary;

import com.businessobjects.rebean.wi.ReportEngine;

import com.businessobjects.rebean.wi.ReportEngines;

import com.businessobjects.rebean.wi.VariableExpression;

import com.crystaldecisions.sdk.exception.SDKException;

import com.crystaldecisions.sdk.framework.CrystalEnterprise;

import com.crystaldecisions.sdk.framework.IEnterpriseSession;

import com.crystaldecisions.sdk.framework.ISessionMgr;

import com.crystaldecisions.sdk.occa.infostore.IInfoObject;

import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;

import com.crystaldecisions.sdk.occa.infostore.IInfoStore;

public class Test {

   public static void main(String[] args) {

IEnterpriseSession enterpriseSession = null;

      ReportEngines reportEngines = null;

      try {

System.out.println("Connecting...");

         ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();

enterpriseSession = sessionMgr.logon("user",

                                                                                "password", "client.local", "secEnterprise");

         reportEngines = (ReportEngines) enterpriseSession

.getService("ReportEngines");

         ReportEngine wiRepEngine = (ReportEngine) reportEngines

.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);        

         IInfoStore infoStore =

(IInfoStore) enterpriseSession.getService("InfoStore");

         String query = "select TOP 20000 SI_NAME, SI_ID, SI_AUTHOR, SI_OWNER, SI_CREATION_TIME, SI_PARENTID, SI_PATH, SI_INSTANCE, SI_UPDATE_TS, SI_LAST_RUN_TIME, SI_LAST_SUCCESSFUL_INSTANCE_ID, SI_TIMESTAMP, SI_KIND "

                                                                                + "from CI_INFOOBJECTS where (SI_KIND = 'FullClient' ) and SI_INSTANCE = 0  order by SI_ID";

         IInfoObjects infoObjects = (IInfoObjects) infoStore.query(query);

         for (Object object : infoObjects) {

IInfoObject infoObject = (IInfoObject) object;

            String path = getInfoObjectPath(infoObject);

      //      if (path.startsWith("/")) {

DocumentInstance widoc = wiRepEngine.openDocument(infoObject.getID());

               String doc = infoObject.getTitle();

System.out.println(path + "/" + doc);              

printDocumentVariables(widoc);

widoc.closeDocument();

      //      }

         }

      }

      catch (SDKException ex) {

ex.printStackTrace();

      }

      finally {

         if (reportEngines != null)

reportEngines.close();

         if (enterpriseSession != null)

enterpriseSession.logoff();

      }

System.out.println("Finished!");

   }

   public static void printDocumentVariables(DocumentInstance widoc ) {

      ReportDictionary dic = widoc.getDictionary();

VariableExpression[] variables = dic.getVariables();

      for (VariableExpression e : variables) {

         String name = e.getFormulaLanguageID();

         String expression = e.getFormula().getValue();

         System.out.println(" " + name + " " + expression);

      }

   }       

   public static String getInfoObjectPath(IInfoObject infoObject)

                                        throws SDKException {

      String path = "";

      while (infoObject.getParentID() != 0) {

         infoObject = infoObject.getParent();

         path = "/" + infoObject.getTitle() + path;

      }

      return path;

   }

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

What is the BusinessObjects Enterprise version you are using.

I see that you are using the Webi report engine service, however you query to infostore  for a 'Fullclient'(Desktop Intelligence Report).

If you have webi reports change the si_kind in query to 'webi'

Thanks,

Prithvi

Former Member
0 Kudos

Thanks Prithviraj!

I am not sure what Business Objects Enterprise version are we using, I don’t have BO installed on my PC. I just got those required jars from admin!

I changed  the si_kind in query to ‘webi’ but  I got zero results with no errors. Is it mean I don’t have any webi  reports to pull?

And if it is for a FullClient, do I need to use different SDK?

Please let me know.

Regards,

Rakhy.

Former Member
0 Kudos

Fullclient is only available for XI 3.1 version. If you are on that version, you would need to call the report engine service as below.

ReportEngine wiRepEngine = (ReportEngine) reportEngines

.getService(ReportEngines.ReportEngineType.FC_REPORT_ENGINE);

Former Member
0 Kudos

Thanks Prithviraj,

When I try that, I am getting below exception at

ReportEngine wiRepEngine = (ReportEngine) reportEngines

.getService(ReportEngines.ReportEngineType.FC_REPORT_ENGINE);

Exception in thread "main" com.businessobjects.rebean.wi.CommunicationException: Unable to instantiate ReportEngine.

  at com.businessobjects.rebean.wi.ReportEngines.createReportEngine(Unknown Source)

  at com.businessobjects.rebean.wi.ReportEngines.getService(Unknown Source)

  at org.middletonc.javatool.program.main(program.java:53)

Caused by: java.lang.ClassNotFoundException: com.businessobjects.rebean.fc.internal.ras21.FullClientReportEngineOCCAFactory

  at java.net.URLClassLoader$1.run(URLClassLoader.java:372)

  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

  at java.security.AccessController.doPrivileged(Native Method)

  at java.net.URLClassLoader.findClass(URLClassLoader.java:360)

  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

  at java.lang.Class.forName0(Native Method)

  at java.lang.Class.forName(Class.java:260)

  at com.crystaldecisions.celib.classloader.ClassLoaderHelper$2.loadClass(ClassLoaderHelper.java:94)

  at com.crystaldecisions.celib.classloader.ClassLoaderHelper.loadClass(ClassLoaderHelper.java:133)

  ... 3 more

Former Member
0 Kudos

You should have rebean.fc.jar in your applications classpath. Ask your server admin to provide you with this jar and also check the BO version.

Former Member
0 Kudos

Thanks Prithviraj,

I have requested for 'rebean.fc.jar'. Once I get that jar file, I will add to my application classpath and let you know the output.

Best regards,

Rakhy.

Former Member
0 Kudos

Hi, I got rebean.fc.jar and added it to my classpath.  I am able to open the document! But when I try to printDocument() I am getting “This feature is not supported for FullClient. (Error: RFC 00301)” error  at

“ReportDictionary dic = widoc.getDictionary();”

And our BO version is : XI3.1 SP7 FP2

Below is my printDocumentObjects2() method

public static void printDocumentObjects2(DocumentInstance widoc,

                     FileWriter fw) {

              ReportDictionary dic = widoc.getDictionary();

            

              for (int i = 0; i < dic.getChildCount(); i++) {

                     ReportExpression e = dic.getChildAt(i);

                     String name = e.getFormulaLanguageID();

                   

                     try {

                           fw.append("\n" + name);

                     } catch (IOException ioe) {

                     }

                     ;

              }

       }

Do I need any additional jars?

Regards,

Rakhy.

Former Member
0 Kudos

Report engine SDks are not fully compilant with Desktop Intelligence Documents(FullClient).

As the error states you cannot get the report Dictionary of a document as this feature is not implemented for Desktop Intelligence reports.

Report Engine SDKs support limited features in terms of deski reports, such as report viewing and not modifying.

Thanks,

Prithvi

Former Member
0 Kudos

Thank you so much Prithvi!

Best Regards,

Rakhy.

Answers (0)