首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >业务对象JAVA ISessionMgr.logon挂起

业务对象JAVA ISessionMgr.logon挂起
EN

Stack Overflow用户
提问于 2017-03-16 19:51:12
回答 1查看 1.2K关注 0票数 0

最近,我们为新的业务对象4.1升级了业务对象XI环境,但我们现在遇到了一些问题

我们有一个托管在Weblogic服务器上的Java应用程序,它使用BO在另一个服务器上调度水晶报告(Windows + tomcat服务器&BO4.1)

下面是用于计划的代码:

代码语言:javascript
复制
  /**
   * 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 retrieve with username'" + username + "' password '" + password + "' cmsName '" + cmsName + "' ");
     }
     else {
        logger.info("Class CrystalReportHelper, BusinessObjectEnterprise Session retrieve 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 retrieved 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 =“从CI_INFOOBJECTS中选择*SI_NAME=‘+ REPLACE_REPORT_NAME +’和SI_INSTANCE = 'false'";

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

代码语言:javascript
复制
    /**
     * 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(用户名、密码、cmsName、CeProgID.SEC_ENTERPRISE);

当这种情况发生时,以下是来自Weblogic的堆栈跟踪:

代码语言:javascript
复制
        "[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock java.lang.Object@3d24ae2c 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)

这在我们的BO环境中从未发生过。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-30 15:35:55

嗨找到了我自己的答案。

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

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

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42843592

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档