cancel
Showing results for 
Search instead for 
Did you mean: 

JRCExportReport.java runtime error

Former Member
0 Kudos

I'm working with the sample code provided in the Java JRC Desktop Export Report Disk PDF.zip file. My goal is to expand on the code to develop a standalone desktop app to export reports to pdf. I'm using jar files from the crjava-runtime_12.2.213.zip file. The code compiles, however I receive the following runtime errors below. If someone could point me in the right direction that would be great. I'm running Red Hat Enterprise Linux 6.2 and the jdk1.6.0_31 jdk.

log4j:WARN No appenders could be found for logger (com.businessobjects.reports.sdk.JRCCommunicationAdapter).

log4j:WARN Please initialize the log4j system properly.

com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:237)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:147)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:128)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:111)

    at com.crystaldecisions.reports.sdk.PrintOutputController.export(SourceFile:54)

    at JRCExportReport.main(JRCExportReport.java:45)

Caused by: java.lang.NullPointerException

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.OpenTypeFontManager.a(SourceFile:384)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.OpenTypeFontManager.do(SourceFile:259)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.OpenTypeFontManager.if(SourceFile:77)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.if(SourceFile:101)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.a(SourceFile:92)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.a(SourceFile:591)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.if(SourceFile:422)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.PdfDocumentManager.a(SourceFile:332)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:1422)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:1377)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:769)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:718)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:672)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.if(SourceFile:622)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:1950)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:446)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.byte(SourceFile:322)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:302)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.b.a(SourceFile:217)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.PdfAdvancedDocumentModeller.a(SourceFile:177)

    at com.crystaldecisions.reports.exporters.page.pdf.AdobePDFExporter.a(SourceFile:252)

    at com.crystaldecisions.reports.exporters.page.pdf.AdobePDFExporter.processFormattedContent(SourceFile:200)

    at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:104)

    at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:247)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:642)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:586)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:636)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1944)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:661)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:167)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:529)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:527)

    at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:525)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:424)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:352)

    at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)

    at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)

    at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)

    at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:223)

    ... 5 more

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

The problem is a bug in Crystal Reports. When embedding the fonts it has used in the printouts, a separate font search mechanism is used than what was used at printing the report (this is why report printing itself succeeds. the crash comes in the embedding phase). This separate font loading mechanism searches in the %java_home%/lib/fonts directory for fonts. The bug is that if no fonts found here, then Crystal crashes with nullpointer exception.

Do copy at least one font file into %java_home%/lib/fonts and You will not crash. Copy all the fonts You use there and print will be all right.

This happens with OpenJdk mainly because OracleJdk has some fonts preinstalled here.

former_member188030
Active Contributor
0 Kudos

Try upgrading to 12.2.18 crjava runtimes.

http://scn.sap.com/docs/DOC-29757

-Bhushan

Former Member
0 Kudos

I was able to resolve this. I found that /usr/bin/java indirectly references the openjdk jre.

# ls -l /usr/bin/java

lrwxrwxrwx. 1 root root 22 Jul  5 11:07 /usr/bin/java -> /etc/alternatives/java

# ls -l  /etc/alternatives/java

lrwxrwxrwx. 1 root root 46 Jul  5 11:07 /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java

Placing /usr/java/jdk1.6.0_31/bin before /usr/bin in the PATH environment variable resolved the issue. Hopefully this will help someone else.