By: Patrick the Pup - patrick_the_pup
Why is *.gif files not found ?
2002-10-10 20:17
Hi guyz...
I have written a servlet to compile the HyperlinkReport.xml to HyperlinkReport.jasper and then uses the static method runReportToHtmlFile() method to generate the html file.
But then, when I run it, it gives me the following error :
(Where shld I place the gif files in ??)
dori.jasper.engine.JRException: Image not found : google.gif
at dori.jasper.engine.util.JRImageLoader.loadImageDataFromLocation(JRImageLoader.java:148)
at dori.jasper.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:331)
at dori.jasper.engine.fill.JRFillImage.evaluate(JRFillImage.java:278)
at dori.jasper.engine.fill.JRFillBand.evaluate(JRFillBand.java:359)
at dori.jasper.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:334)
at dori.jasper.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:250)
at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:160)
at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:379)
at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:143)
at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:348)
at dori.jasper.engine.JasperRunManager.runReportToHtmlFile(JasperRunManager.java:382)
at servlets.TestingJasperReportServlet.service(TestingJasperReportServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)
By: Teodor Danciu - teodord
RE: Why is *.gif files not found ?
2002-10-11 13:24
Hi,
Check the "webapp" sample.
The recommended way to work with images is to
place them somewhere in the classpath and use
<imageExpression> elements that return String
values.
That's because the engine will use
JRImageLoader.loadImageDataFromLocation(String) method.
This method first tries to see whether the String
is a valid URL. If it isn't, it tries to see if can find
a file on disk, at the specified location. If that also
fails, it will try to load a resource from the specified
location, searching in the classpath.
Note that in Web environment you have to find the
correct path to the file, if you are trying to work with
filenames. Check the "webapp" sample to see how
we pass the base directory to the subreport, as a
report parameter.
Good luck!
Teodor
Why is *.gif files not found ?
2002-10-10 20:17
Hi guyz...
I have written a servlet to compile the HyperlinkReport.xml to HyperlinkReport.jasper and then uses the static method runReportToHtmlFile() method to generate the html file.
But then, when I run it, it gives me the following error :
(Where shld I place the gif files in ??)
dori.jasper.engine.JRException: Image not found : google.gif
at dori.jasper.engine.util.JRImageLoader.loadImageDataFromLocation(JRImageLoader.java:148)
at dori.jasper.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:331)
at dori.jasper.engine.fill.JRFillImage.evaluate(JRFillImage.java:278)
at dori.jasper.engine.fill.JRFillBand.evaluate(JRFillBand.java:359)
at dori.jasper.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:334)
at dori.jasper.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:250)
at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:160)
at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:379)
at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:143)
at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:348)
at dori.jasper.engine.JasperRunManager.runReportToHtmlFile(JasperRunManager.java:382)
at servlets.TestingJasperReportServlet.service(TestingJasperReportServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)
By: Teodor Danciu - teodord
RE: Why is *.gif files not found ?
2002-10-11 13:24
Hi,
Check the "webapp" sample.
The recommended way to work with images is to
place them somewhere in the classpath and use
<imageExpression> elements that return String
values.
That's because the engine will use
JRImageLoader.loadImageDataFromLocation(String) method.
This method first tries to see whether the String
is a valid URL. If it isn't, it tries to see if can find
a file on disk, at the specified location. If that also
fails, it will try to load a resource from the specified
location, searching in the classpath.
Note that in Web environment you have to find the
correct path to the file, if you are trying to work with
filenames. Check the "webapp" sample to see how
we pass the base directory to the subreport, as a
report parameter.
Good luck!
Teodor
0 Answers:
No answers yet