Using relative path for static image in Jfree report template

I have a JfreeReport application that runs under Tomcat inside a jar. In the report template (which exists outside the jar) I have the following: File: ///var/lib/tomcat5.5/webapps/Reports/images/logo.gif But then I get an exception: org.jfree.report.modules .ModuleInitializeException: Unable to create the specified directory. Then I tried using a relative path, but I got a FileNotFoundException. I am unable to provide an HTTP link for the file. Any idea how to use a relative path or file url?

0


source to share


2 answers


How your report is requested. If this happens again, for example

http://example.com/Reports/some-report



Then you need to use images / logo.gif

0


source


An exception thrown in a module indicates an error during loading / initialization of the reporting engine.

I would say you have a security manager installed that blocks write access to the home directory (the default location where the cache files will be stored). Or reconfigure the location by setting configuration properties

org.jfree.report.modules.misc.configstore.filesystem.SystemTargetDir=your/path/here
org.jfree.report.modules.misc.configstore.filesystem.UserTargetDir=your/path/here

      



to a location where you have write access, or disable caching altogether (at the cost of a longer startup time each time Tomcat restarts) by setting the config property to an empty string (as shown below):

org.jfree.report.modules.misc.configstore.filesystem.Module=

      

The configuration can be set either by creating a "jfreereport.properties" file in the WEB-INF / classes directory, or by setting properties using the System properties (for instances in the Web.xml file).

0


source







All Articles