[#13176] - Cannot run sparkline inside a java project

Category:
General
Priority:
Urgent
Status:
New
Project: Severity:
Block
Resolution:
Open
Component: Reproducibility:
N/A
Assigned to:
0

I tried to run a custom visualization jasper report with sparkline inside a java project with Tomcat server and I got this error :

-------------------------
2020-10-19 15:20:00.145 WARN 46554 --- [nio-8443-exec-4] c.j.j.c.export.CVElementHtmlHandler : No property set for the require.js path. Please set the property com.jaspersoft.jasperreports.components.customvisualization.require.js
2020-10-19 15:20:00.277 ERROR 46554 --- [nio-8443-exec-4] c.j.j.c.export.CVElementImageProvider : Generating image for Custom Visualization element 959943177 failed.

net.sf.jasperreports.engine.JRRuntimeException: Error while executing the javascript file to generate the SVG image: java.io.IOException: Cannot run program "phantomjs" (in directory "/var/folders/hr/hv2qhgzd2yz5xfzpm1zfp0pw0000gp/T"): error=2, No such file or directory
at com.jaspersoft.jasperreports.customvisualization.export.CVElementPhantomJSImageProvider.getImageData(CVElementPhantomJSImageProvider.java:203) ~[jasperreports-customvisualization-6.4.3.jar:na]
at com.jaspersoft.jasperreports.customvisualization.export.CVElementImageProvider.getImage(CVElementImageProvider.java:150) ~[jasperreports-customvisualization-6.4.3.jar:na]
at com.jaspersoft.jasperreports.customvisualization.export.CVElementPdfHandler.exportElement(CVElementPdfHandler.java:60) [jasperreports-customvisualization-6.4.3.jar:na]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportGenericElement(JRPdfExporter.java:3210) [jasperreports-6.8.0.jar:6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:1112) [jasperreports-6.8.0.jar:6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:1063) [jasperreports-6.8.0.jar:6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:927) [jasperreports-6.8.0.jar:6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:547) [jasperreports-6.8.0.jar:6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b]
at net.sf.jasperreports.engine.JasperExportManager.exportToPdfStream(JasperExportManager.java:196) [jasperreports-6.8.0.jar:6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b]
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:533) [jasperreports-6.8.0.jar:6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b]

-------------------------

I have set in properties file the path for require.js and also for phantomjs

com.jaspersoft.jasperreports.components.customvisualization.phantomjs.executable.path=/Users/someUser/Documents/phantomjs-2.1.1-macosx/bin
com.jaspersoft.jasperreports.components.customvisualization.require.js=/Users/someUser/Documents/src/main/resources/static/node_modules/jquery-ui/external/requirejs/require.js

Please let me know what is wrong or missing

v7
JasperReports
someUser's picture
Joined: Sep 7 2011 - 1:09pm
Last seen: 3 weeks 3 days ago

5 Comments:

#1

After upgrading to 6.15 version I got new error

_______________________________

2020-10-19 16:06:43.004 ERROR 50073 --- [nio-8443-exec-8] n.s.j.c.export.CVElementImageProvider : Generating image for Custom Visualization element element1051706650747058896510752785935933768062 failed.

net.sf.jasperreports.engine.JRRuntimeException: Chrome and/or PhantomJS not properly configured for server side rendering
at net.sf.jasperreports.customvisualization.export.CVElementDefaultImageDataProvider.getImageData(CVElementDefaultImageDataProvider.java:72) ~[jasperreports-custom-visualization-6.15.0.jar:na]
at net.sf.jasperreports.customvisualization.export.CVElementImageProvider.createRenderable(CVElementImageProvider.java:131) [jasperreports-custom-visualization-6.15.0.jar:na]
at net.sf.jasperreports.customvisualization.export.CVElementImageProvider.getImage(CVElementImageProvider.java:84) [jasperreports-custom-visualization-6.15.0.jar:na]
at net.sf.jasperreports.customvisualization.export.CVElementPdfHandler.exportElement(CVElementPdfHandler.java:56) [jasperreports-custom-visualization-6.15.0.jar:na]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportGenericElement(JRPdfExporter.java:4141) [jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:1290) [jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:1210) [jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:1074) [jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:691) [jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.engine.JasperExportManager.exportToPdfStream(JasperExportManager.java:196) [jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:533) [jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
--------------------

#2
  • Priority:Normal» Urgent
  • Severity:Minor» Major
#3
  • Severity:Major» Block
#4

I have added jasperreports.properties file in classpath where is specified that Chrome is enabled and now I get this error :

2020-10-20 15:05:47.348 WARN 93878 --- [io-8443-exec-10] net.sf.jasperreports.chrome.Chrome : Failed to load CDT class: java.lang.ClassNotFoundException: com.github.kklisura.cdt.launch.ChromeLaunche
2020-10-20 15:05:47.352 INFO 93878 --- [io-8443-exec-10] n.s.j.phantomjs.ScriptManager : PhantomJS temp folder is /var/folders/hr/hv2qhgzd2yz5xfzpm1zfp0pw0000gp/T/
2020-10-20 15:05

#5

Ok, I added compile group: 'com.github.kklisura.cdt', name: 'cdt-java-client', version: '2.1.0' in gradle build file and I got
net.sf.jasperreports.engine.JRRuntimeException: java.util.concurrent.TimeoutException
at net.sf.jasperreports.chrome.BrowserService.lambda$evaluateInPage$1(BrowserService.java:149) ~[jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.chrome.StandardPageCreator.lambda$runInPage$0(StandardPageCreator.java:65) ~[jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports.chrome.ChromeInstance.runWithChromeInstance(ChromeInstance.java:92) ~[jasperreports-6.15.0.jar:6.15.0-dd49bfb94918336b8321d5507193f0169ead4e95]
at net.sf.jasperreports

Feedback
randomness