I'm facing strange error with grails and jasper report. In development everything ok, it can generate pdf successfully.
The problem when I run in production (aws ec2, ubuntu and tomcat7). It throws error:
2014-11-10 05:25:46,604 [http-bio-8080-exec-5] ERROR errors.GrailsExceptionResolver - JRException occurred when processing request: [GET] /jasper/index
Image read failed.. Stacktrace follows:
net.sf.jasperreports.engine.JRException: Image read failed.
at net.sf.jasperreports.engine.util.JRJdk14ImageReader.readImage(JRJdk14ImageReader.java:73)
at net.sf.jasperreports.engine.util.JRImageLoader.loadAwtImageFromBytes(JRImageLoader.java:167)
at net.sf.jasperreports.engine.JRImageRenderer.getImage(JRImageRenderer.java:418)
at net.sf.jasperreports.engine.JRImageRenderer.getOnErrorRendererForImage(JRImageRenderer.java:321)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportImage(JRPdfExporter.java:1482)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:957)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:920)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:797)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:514)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:49)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
I get image from url. Is there something I miss?
Thanks, Didin
Here's ireport code:
But why this code working fine in my local machine, not in aws ec2?