#java #ubuntu #crystal-reports
Вопрос:
Я использую jar-файлы Crystal report viewer (он поддерживает JDK 11) для Java Swing. Он отлично работает в Windows, но выдает ошибку нулевого указателя в Ubuntu 18. По умолчанию Ubuntu содержит OpenJDK 11, поэтому удалил его и установил также Oracle JDK. Тем не менее проблема сохраняется. Ниже приведена ошибка.
12:38:34.268 [AWT-EventQueue-0] ERROR com.businessobjects.reports.sdk.JRCCommunicationAdapter - detected an exception: java.lang.NullPointerException
at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.OS2Table.<init>(SourceFile:108)
at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.if(SourceFile:116)
at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.a(SourceFile:104)
at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.if(SourceFile:594)
at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.a(SourceFile:424)
at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.PdfDocumentManager.a(SourceFile:337)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:1584)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:1492)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:780)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:729)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:683)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.if(SourceFile:633)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:1951)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:447)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.byte(SourceFile:323)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:303)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:283)
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:105)
at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:253)
at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:647)
at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:597)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:641)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:677)
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:526)
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.dt.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:224)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:148)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:129)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:112)
at main.BillPrintUsingPDF.Print(BillPrintUsingPDF.java:46)
at main.DotMatrixPrinting.actualPrint(DotMatrixPrinting.java:47)
at main.PrintPreview$3.actionPerformed(PrintPreview.java:122)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6400)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.desktop/java.awt.Dialog.show(Dialog.java:1070)
at java.desktop/java.awt.Component.show(Component.java:1716)
at java.desktop/java.awt.Component.setVisible(Component.java:1663)
at java.desktop/java.awt.Window.setVisible(Window.java:1031)
at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1005)
at main.PrintPreview.showTextFileWithPrintOption(PrintPreview.java:157)
at main.DotMatrixPrinting.print(DotMatrixPrinting.java:31)
at report.DMPReceiptBillingOPStaff.printToDotMatrixPrinter(DMPReceiptBillingOPStaff.java:295)
at report.DMPReceiptBillingOPStaff.printingViaDOS(DMPReceiptBillingOPStaff.java:182)
at investigation.BillingOPStaffReprint.printOPBillingStaff(BillingOPStaffReprint.java:939)
at investigation.BillingOPStaffReprint$9.mouseClicked(BillingOPStaffReprint.java:357)
at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:278)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6638)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6400)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4556)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
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:238)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:148)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:129)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:112)
at main.BillPrintUsingPDF.Print(BillPrintUsingPDF.java:46)
at main.DotMatrixPrinting.actualPrint(DotMatrixPrinting.java:47)
at main.PrintPreview$3.actionPerformed(PrintPreview.java:122)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6400)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.desktop/java.awt.Dialog.show(Dialog.java:1070)
at java.desktop/java.awt.Component.show(Component.java:1716)
at java.desktop/java.awt.Component.setVisible(Component.java:1663)
at java.desktop/java.awt.Window.setVisible(Window.java:1031)
at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1005)
at main.PrintPreview.showTextFileWithPrintOption(PrintPreview.java:157)
at main.DotMatrixPrinting.print(DotMatrixPrinting.java:31)
at report.DMPReceiptBillingOPStaff.printToDotMatrixPrinter(DMPReceiptBillingOPStaff.java:295)
at report.DMPReceiptBillingOPStaff.printingViaDOS(DMPReceiptBillingOPStaff.java:182)
at investigation.BillingOPStaffReprint.printOPBillingStaff(BillingOPStaffReprint.java:939)
at investigation.BillingOPStaffReprint$9.mouseClicked(BillingOPStaffReprint.java:357)
at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:278)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6638)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6400)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4556)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NullPointerException
at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.OS2Table.<init>(SourceFile:108)
at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.if(SourceFile:116)
at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.a(SourceFile:104)
at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.if(SourceFile:594)
at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.a(SourceFile:424)
at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.PdfDocumentManager.a(SourceFile:337)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:1584)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:1492)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:780)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:729)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.a(SourceFile:683)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.a.if(SourceFile:633)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:1951)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:447)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.byte(SourceFile:323)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:303)
at com.crystaldecisions.reports.exporters.format.page.pdf.dom.d.a(SourceFile:283)
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:105)
at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:253)
at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:647)
at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:597)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:641)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:677)
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:526)
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.dt.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:224)
... 85 more
{
**ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
reportClientDoc.close();**
//ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
byte byteArray[] = new byte[byteArrayInputStream.available()];
File file = new File(EXPORT_FILE);
FileOutputStream fileOutputStream = new FileOutputStream(file);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(byteArrayInputStream.available());
int x = byteArrayInputStream.read(byteArray, 0, byteArrayInputStream.available());
byteArrayOutputStream.write(byteArray, 0, x);
byteArrayOutputStream.writeTo(fileOutputStream);
byteArrayInputStream.close();
byteArrayOutputStream.close();
fileOutputStream.close();
PDDocument pd= PDDocument.load(file);
PrinterJob job = PrinterJob.getPrinterJob();
job.setPageable(new PDFPageable(pd,Orientation.LANDSCAPE));
PDFPageable nice=new PDFPageable(pd,Orientation.AUTO);
//job.setPrintable(new PDFPrintable(pd,Scaling.ACTUAL_SIZE));
job.print();
}
Ответ №1:
Похоже, проблема со шрифтами и в том, что Crystal Report использует шрифты MS Core, которые необходимо установить в системе Linux.
Вы следовали инструкциям на https://reportserver.net/en/guides/admin/chapters/SAP-Crystal-Reports/ ?
Шаги, необходимые для установки в системах Ubuntu, следующие:
Если ваш дистрибутив Linux основан на Debian (это относится к пакетам Bitnami), вы можете выполнить следующие команды для установки основных шрифтов MS TrueType:
echo "deb http://deb.debian.org/debian buster contrib" >> /etc/apt/sources.list
apt-get update amp;amp; apt-get install ttf-mscorefonts-installer
ln -s /usr/share/fonts/truetype/msttcorefonts /opt/bitnami/java/lib/fonts
В зависимости от вашего дистрибутива Linux вам также может потребоваться проверить следующий каталог:
/usr/lib/jvm/default-jvm/jre/lib/fonts
После успешной установки пакета ttf-mscorefonts вы сможете запускать Crystal reports в среде на базе Linux.