0

我们最近升级了我们的业务对象XI环境,一个新的业务对象4.1,但现在我们遇到一些问题,它Business Objects的JAVA SDK ISessionMgr.logon挂

我们的Java Web应用程序托管在WebLogic服务器上使用BO SDK安排另一台服务器上的Crystal Report(VM的Windows + Tomcat服务器& BO 4.1)

下面是使用日程表的代码:

/** 
    * Schedule a report inside CrystalReport 
    */ 
    public void executeReport(ReportContext reportContext) throws Exception { 
    logger.info("Class CrystalReportHelper, Executing report request for report '" + reportContext.getReportName() + "'"); 

    IEnterpriseSession enterpriseSession = null; 
    try { 
    String password = getPassword(reportContext); 
    logger.info("Class CrystalReportHelper, Retrievieving password "); 
    if (password != null) { 
     if (logger.isDebugEnabled()) { 
      logger.debug("Class CrystalReportHelper, Password obtained '" + password + "'"); 
     } 
     else { 
      logger.info("Class CrystalReportHelper, Password obtained "); 
     } 
    } 
    else { 
     logger.error("Class CrystalReportHelper, Invalid password for BO Logon"); 
     throw new Exception("Invalid password for BO Logon - password is null"); 
    } 

    String username = getUserName(reportContext); 
    logger.info("Class CrystalReportHelper, Retrievieving username "); 
    if (username != null) { 
     logger.info("Class CrystalReportHelper, User name obtained '" + username + "'"); 
    } 
    else { 
     logger.error("Class CrystalReportHelper, Invalid username for BO Logon"); 
     throw new Exception("Invalid username for BO Logon - username is null"); 
    } 

    String cmsName = getCentralManagementServerName(); 
    logger.info("Class CrystalReportHelper, Retrievieving Central Management Server Name "); 
    if (cmsName != null) { 
     logger.info("Class CrystalReportHelper,Central Management Server Name obtained = " + cmsName); 
    } 
    else { 
     logger.error("Class CrystalReportHelper, Invalid Central Management Server Name for BO Logon."); 
     throw new Exception("Invalid Central Management Server Name for BO Logon - Central Management Server Name is null"); 
    } 

    enterpriseSession = getSession(username, password, cmsName); 
    if (logger.isDebugEnabled()) { 
     logger.debug("Class CrystalReportHelper, Retrieving BusinessObjectEnterprise Session with username'" + username + "' password '" + password + "' cmsName '" + cmsName + "' "); 
    } 
    else { 
     logger.info("Class CrystalReportHelper, Retrieving BusinessObjectEnterprise Session with username'" + username + "' password '" + "XXXX" + "' cmsName '" + cmsName + "' "); 
    } 
    if (enterpriseSession == null) { 
     logger.error("Class CrystalReportHelper, Coud not retrieve BusinessObjectEnterprise Session with username'" + username + "' password '" + password + "' cmsName '" + cmsName + "' "); 
     throw new Exception("Could not retreive BO Session with username : " + username + " and CMS : " + cmsName); 
    } 
    if (logger.isDebugEnabled()) { 
     logger.debug("Class CrystalReportHelper, BusinessObjectEnterprise Session retireve with username'" + username + "' password '" + password + "' cmsName '" + cmsName + "' "); 
    } 
    else { 
     logger.info("Class CrystalReportHelper, BusinessObjectEnterprise Session Retireve with username'" + username + "' password '" + "XXXX" + "' cmsName '" + cmsName + "' "); 
    } 

    IInfoStore infoStore = (IInfoStore) enterpriseSession.getService(cmsName, BO_INFO_STORE); 
    logger.info("Class CrystalReportHelper, Retrieving BO service with cmsName'" + cmsName + "' BO_INFO_STORE '" + BO_INFO_STORE + "'"); 
    if (infoStore == null) { 
     logger.error("Class CrystalReportHelper, Coud not obtain BO service with cmsName'" + cmsName + "' BO_INFO_STORE '" + BO_INFO_STORE + "'"); 
     throw new Exception("Could not obtain BO service : " + BO_INFO_STORE); 
    } 

    // Queries the CMS for the report. 
    logger.info("Class CrystalReportHelper, BO service retireved with cmsName'" + cmsName + "' BO_INFO_STORE '" + BO_INFO_STORE + "'"); 

    String queryReport = REPORT_QUERY.replaceFirst(REPLACE_REPORT_NAME, getReportName(reportContext)); 

    logger.info("Class CrystalReportHelper, Executing query report '" + queryReport + "'."); 
    IInfoObjects reports = infoStore.query(queryReport); 
    if (reports.size() == 0) { 
     logger.error("Class CrystalReportHelper, Report '" + queryReport + "' not found.."); 
     throw new Exception("Report " + getReportName(reportContext) + " not found in BusinessObject"); 
    } 
    IReport report = (IReport) reports.get(0); 

    // Set report format. 
    IReportFormatOptions reportFormat = report.getReportFormatOptions(); 

    int formatType = IReportFormatOptions.CeReportFormat.CRYSTAL_REPORT; 
    reportFormat.setFormat(formatType); 

    String destinationInbox = getDestinationInbox(reportContext); 
    IDestinationPlugin destinationPlugin = getDestinationPlugin(infoStore, destinationInbox); 

    // Create an interface to the scheduling options for the report. 
    ISchedulingInfo scheduleInfo = report.getSchedulingInfo(); 
    scheduleInfo.setType(CeScheduleType.ONCE); 
    scheduleInfo.setRightNow(true); 

    IDestination destination = scheduleInfo.getDestination(); 
    destination.setFromPlugin(destinationPlugin); 

    // copy the report parameters 
    this.setParameters(reportContext, report); 

    logger.info("Class CrystalReportHelper, Scheduling report '" + getReportName(reportContext) + "'. "); 
    infoStore.schedule(reports); 
    logger.info("Class CrystalReportHelper, Report '" + getReportName(reportContext) + "' has been scheduled. "); 

    if (reportContext.isEmailRequired() & isEmailEnabled()) { 
     sendEmail(reportContext); 
    } 
    } 
    catch (SDKRuntimeException SDKre) { 
    logger.error("Class CrystalReportHelper, Could not execute report request for report '" + reportContext.getReportName() + "' caught SDKRuntimeException: " + SDKre.getMessage(), SDKre); 
    throw new Exception(SDKre); 
    } 
    catch (SDKException SDKe) { 
    logger.error("Class CrystalReportHelper, Could not execute report request for report '" + reportContext.getReportName() + "' caught SDKException: " + SDKe.getMessage(), SDKe); 
    throw new Exception(SDKe); 
    } 
    finally { 
    if (null != enterpriseSession) { 
     enterpriseSession.logoff(); 
    } 
    } 

这里有一些数据信息:

  1. Reportcontext包含像用户/密码为BO,报告名称,并报告提示参数使用
  2. BO_INFO_STORE =“InfoStore”; “
  3. REPORT_QUERY =”Select * from CI_INFOOBJECTS WHERE SI_NAME ='“+ REPLACE_REPORT_NAME +”'AND SI_INSTANCE ='false'“;

下面是用于连接到BO的方法的getSession:

/** 
    * return BusinessObjectEnterprise session 
    * 
    * @param username 
    * @param password 
    * @return IEnterpriseSession 
    * @throws SDKException 
    */ 
    public IEnterpriseSession getSession(String username, String password,  String cmsName) throws SDKException { 
    logger.debug("Class CrystalReportHelper, Retrieving BusinessObjectEnterprise Session username'" + username + "' password '" + password + "' cmsName '" + cmsName + "' "); 

    IEnterpriseSession enterpriseSession = null; 
    ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr(); 

    boolean isAuthenticateEnterprise = getReportProperties().getAuthenticationTypeEnterprise(); 
    logger.debug("Class CrystalReportHelper, isAuthenticateEnterprise '" + isAuthenticateEnterprise + "' "); 
    if (isAuthenticateEnterprise) { 
    enterpriseSession = sessionMgr.logon(username, password, cmsName, CeProgID.SEC_ENTERPRISE); 
    } 
    else { 
    enterpriseSession = sessionMgr.logon(username, password, cmsName, CeProgID.SEC_LDAP); 
    } 

    logger.debug("Class CrystalReportHelper, BusinessObjectEnterprise Session obtained for username'" + username + "' password '" + password + "' cmsName '" + cmsName + "' "); 
    return enterpriseSession; 

}

我们遇到的问题是有时进程会继续留在这一行约45分钟:

enterpriseSession = sessionMgr.logon(username,password,cmsName,CeProgID.SEC_ENTERPRISE);

下面是从Weblogic的堆栈跟踪发生这种情况时:

 "[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock [email protected] WAITING 

      java.lang.Object.wait(Native Method) 

      java.lang.Object.wait(Object.java:485) 

         com.crystaldecisions.thirdparty.com.ooc.OB.Downcall.waitUntilCompleted(Downcall.java:831) 

         com.crystaldecisions.thirdparty.com.ooc.OB.GIOPClientWorkerThreaded.receive(GIOPClientWorkerThreaded.java:327) 

         com.crystaldecisions.thirdparty.com.ooc.OB.GIOPClientWorkerThreaded.sendReceive(GIOPClientWorkerThreaded.java:353) 

      com.crystaldecisions.thirdparty.com.ooc.OB.Downcall.request(Downcall.java:336) 

      com.crystaldecisions.thirdparty.com.ooc.OB.DowncallStub.invoke(DowncallStub.java:583) 

      com.crystaldecisions.thirdparty.com.ooc.CORBA.Delegate.invoke(Delegate.java:579) 

         com.crystaldecisions.thirdparty.org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:125) 

         com.crystaldecisions.enterprise.ocaframework.idl.ImplServ._OSCAFactoryStub.newService(_OSCAFactoryStub.java:78) 

      com.crystaldecisions.enterprise.ocaframework.i.a(Unknown Source) 

      com.crystaldecisions.enterprise.ocaframework.i.a(Unknown Source) 

      com.crystaldecisions.enterprise.ocaframework.i.buildClusterInfo(Unknown Source) 

      com.crystaldecisions.enterprise.ocaframework.aa.int(Unknown Source) 

      com.crystaldecisions.enterprise.ocaframework.ServiceMgr.int(Unknown Source) 

      com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source) 

      com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source) 

      com.crystaldecisions.sdk.occa.security.internal.f.if(Unknown Source) 

      com.crystaldecisions.sdk.occa.security.internal.f.<init>(Unknown Source) 

         com.crystaldecisions.sdk.occa.security.internal.SecurityFactory.makeSecuritySession(Unknown Source) 

      com.crystaldecisions.sdk.occa.security.internal.t.a(Unknown Source) 

      com.crystaldecisions.sdk.occa.security.internal.t.userLogon(Unknown Source) 

      com.crystaldecisions.sdk.occa.security.internal.l.userLogon(Unknown Source) 

      com.crystaldecisions.sdk.framework.internal.b.logon(Unknown Source) 

         com.tranme.guide.commonservices.report.CrystalReportHelper.getSession(CrystalReportHelper.java:156) 

         com.tranme.guide.commonservices.report.CrystalReportHelper.getReportInfoObjectsByReportName(CrystalReportHelper.java:503) 

         com.tranme.guide.notificationmgt.manager.reports.util.ReportManagementTools.getReportInstanceStatuses(ReportManagementTools.java:81) 

         com.tranme.guide.notificationmgt.manager.reports.util.ReportManagementTools.getGenerationStatusResults(ReportManagementTools.java:51) 

         com.tranme.guide.notificationmgt.manager.BaseNotificationManager.updateReportGenerationStatus(BaseNotificationManager.java:244) 

         com.tranme.guide.notificationmgt.business.ejb.impl.NotificationManagementFacadeBeanImpl.updateReportGenerationStatus(NotificationManagementFacadeBeanImpl.java:123) 

         com.tranme.guide.notificationmgt.business.ejb.impl.NotificationManagementFacadeBeanImpl_z3lp9c_EOImpl.updateReportGenerationStatus(NotificationManagementFacadeBeanImpl_z3lp9c_EOImpl.java:140) 

         com.tranme.guide.notificationmgt.business.ejb.impl.NotificationManagementFacadeBeanImpl_z3lp9c_EOImpl_WLSkel.invoke(Unknown Source) 

      weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589) 

      weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230) 

      weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477) 

      weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) 

      weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147) 

      weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473) 

      weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118) 

      weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) 

      weblogic.work.ExecuteThread.run(ExecuteThread.java:173) 

     "Business Objects - Sessions Clean up" TIMED_WAITING 

      java.lang.Thread.sleep(Native Method) 

      com.crystaldecisions.enterprise.ocaframework.n.run(Unknown Source) 

      java.lang.Thread.run(Thread.java:619) 

     "OracleTimeoutPollingThread" TIMED_WAITING 

      java.lang.Thread.sleep(Native Method) 

      oracle.jdbc.driver.OracleTimeoutPollingThread.run(OracleTimeoutPollingThread.java:150) 

这从来没有在我们的薄熙来环境在发生之前。

回答

0

嗨找到我自己的答案。

对于面临同样问题的人们:我们在两台机器之间有防火墙。

当我们打开我们的应用程序和BO之间的连接时,该端口在应用程序端动态选择。

现在,我们禁用了防火墙,并正在研究一种设置应用端使用的静态端口的方法。