cancel
Showing results for 
Search instead for 
Did you mean: 

StringIndexOutOfBoundsException-Export Supervisor (page no. = 1 & horz page

Former Member
0 Kudos

Sorry. I'm struggling with layout problem of my previous question. I hope this one will be better.

We are using the following crystalreport runtime. But we got Export Supervisor (page no. = 1 & horz page 0)

java.lang.StringIndexOutOfBoundsException about one per month roughly so far in production. Once it failed, the subsequent request from different users for getting crystal report would fail too. It seems like the crystal report engine couldn't recover from the first failure. Once fails, it always fails. We have to recycle the weblogic server to bring the application and crystal report back up again. Obviously, this is not a good thing in production. The good thing is that we have two servers in production. When this issue happens on one server, the other server continues to work for the application and crystal report. So this issue is not affecting the working server.

Can some expert here explain what does (page no. = 1 & horz page 0) mean? I have also attached the code snippet we have with has startPageNum, endPageNum in there. Could these two page nums create the problem? And any advise on

1. how to prevent the crystal report engine to recover from the first failure, meaning even if fails for the first request, the subsequent request from different users should continue to work.

2. how to fix the issue from the first place.

Thanks and any insights are greatly appreciated!

Eric

Manifes file

Manifest-Version: 1.0

Ant-Version: Apache Ant 1.7.0

Created-By: 1.5.0_12-b04 (Sun Microsystems Inc.)

Product-Name: Crystal Reports Runtime Components

Implementation-Title: Crystal Reports Runtime Components

Implementation-Version: 12.2.200.454

Implementation-Vendor: Business Objects, Inc.(C)

The code snippet:

public byte[] getCrystalReportByType(URL reportURL, Map<String, Object> paramMap, CRExportType exportType,

int startPageNum, int endPageNum) throws Exception {

InputStream is = null;

ReportClientDocument clientDoc = null;

byte[] doc;

try {

URI uri = reportURL.toURI();

clientDoc= ReportClientDocument.openReport(new File(uri));

Set<Map.Entry<String, Object>> entrySet = paramMap.entrySet();

for (Map.Entry<String, Object> entry : entrySet) {

String param = entry.getKey();

CrystalReportServiceHelper.addDiscreteParameterValue(clientDoc, "", param, entry.getValue());

sLogService.debug("Setting parameters " + param + ": " + entry.getValue());

}

PageBasedExportFormatOptions formatOptions;

switch (exportType) {

case RTF:

formatOptions = new RTFWordExportFormatOptions();

break;

case WORD:

formatOptions = new RTFWordExportFormatOptions();

break;

case EXCEL:

formatOptions = new ExcelExportFormatOptions();

break;

default:

formatOptions = new PDFExportFormatOptions();

}

if (startPageNum > 0 && endPageNum > 0) {

formatOptions.setStartPageNumber(startPageNum);

formatOptions.setEndPageNumber(endPageNum);

}

ExportOptions exportOptions = new ExportOptions();

exportOptions.setExportFormatType(ReportExportFormat.from_int(exportType.getId()));

exportOptions.setFormatOptions(formatOptions);

is = new BufferedInputStream(clientDoc.getPrintOutputController().export(exportOptions));

ByteArrayOutputStream byteOs = new ByteArrayOutputStream();

byte[] data = new byte[1024];

while (is.read(data) > -1) {

byteOs.write(data);

}

doc = byteOs.toByteArray();

} catch (Exception e) {

sLogService.error("Error getting crystal report: " , e);

throw e;

} finally {

if (clientDoc != null)

clientDoc.close();

if (is != null)

is.close();

}

return doc;

Eric

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Here is the Java Exception we're getting:

Export Supervisor (page no. = 1 & horz page 0)

java.lang.StringIndexOutOfBoundsException

at java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:702)

at java.lang.StringBuilder.delete(StringBuilder.java:255)

at com.crystaldecisions.reports.common.logging.LoggerServiceProvider.a(Unknown Source)

at com.crystaldecisions.reports.common.logging.LoggerServiceProvider.logInfo(Unknown Source)

at com.crystaldecisions.reports.formatter.export2.a.a(Unknown Source)

at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(Unknown Source)

at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(Unknown Source)

at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(Unknown Source)

at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)

at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)

at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)

at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)

at gov.treas.fms.ccmm.otcnet.crystalreports.service.CrystalReportServiceImpl.getCrystalReportByType(CrystalReportServiceImpl.java:97)

at gov.treas.fms.ccmm.otcnet.crystalreports.service.CrystalReportServiceImpl$$FastClassByCGLIB$$daf878b1.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)

at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)

at gov.treas.fms.ccmm.otcnet.crystalreports.service.CrystalReportServiceImpl$$EnhancerByCGLIB$$8e1a959e.getCrystalReportByType(<generated>)

at gov.treas.fms.ccmm.otcnet.checkprocess.web.crystalreports.CrystalReportServlet.doPost(CrystalReportServlet.java:175)

at gov.treas.fms.ccmm.otcnet.checkprocess.web.crystalreports.CrystalReportServlet.doGet(CrystalReportServlet.java:95)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)

at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)

at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

at gov.treas.fms.ccmm.otcnet.depositprocess.web.filter.CompressionFilter.doFilter(CompressionFilter.java:170)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)

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

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