views:

401

answers:

2

I have a JfreeReport Application which run 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 exception: org.jfree.report.modules.ModuleInitializeException: Unable to create the specified directory. Then I tried to use relative path but got FileNotFoundException. I can't give a HTTP link for the file. Any idea how to use relative path or file URL?

A: 

How is your report requested. If it is resquest like

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

Then you need to use images/logo.gif

TRF
A: 

A module initialized exception indicates a error during the booting/initializing of the reporting engine.

I'd say, you have a security manager installed, which blocks write-access to the home directory (the default location where the font-caches will be stored). Either reconfigure the location by setting the configuation 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 the caching altogether (at the expense of a longer startup time, each time you restart Tomcat) 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 the properties via System-properties (for instances in the Web.xml file).

Thomas Morgner