最近、Business Object XI 環境を新しい Business Objects 4.1 用にアップグレードしましたが、現在、いくつかの問題が発生しています。
BO SDK を使用して別のサーバー (Windows VM + tomcat サーバー & BO 4.1) で Crystal Report をスケジュールする Weblogic サーバーでホストされている Java Web アプリケーションがあります。
スケジュールに使用されるコードは次のとおりです。
/**
* 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();
}
}
ここにいくつかのデータ情報があります:
- Reportcontext には、 BO のユーザー/パスワード、レポート名、使用するレポート プロンプト パラメータなどが含まれます。
- BO_INFO_STORE = “インフォストア”;
- 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(ユーザー名、パスワード、cmsName、CeProgID.SEC_ENTERPRISE);
これが発生したときのWeblogicからのスタックトレースは次のとおりです。
"[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 XI 環境でこれまでに発生したことはありません。