Check out
http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements
(the "cache-file" setting)
This will enable you to specify where to place the font cache. Just
disabling the font cache might have negative implications for
performance. HTH
On 29.09.2010 09:27:48 Shyrtol wrote:
>
> I've tested FOP for a while and I really like it so far, however yesterday I
> encountered a problem.
>
> I've created a Servlet which outputs a PDF that works perfectly on my
> machine, but when I run it on my web-hoster's servers I get a:
> java.security.AccessControlException: access denied (java.io.FilePermission
> /usr/local/tomcat/.fop/fop-fonts.cache read)
> java.security.AccessControlContext.checkPermission(Unknown Source)
> java.security.AccessController.checkPermission(Unknown Source)
> java.lang.SecurityManager.checkPermission(Unknown Source)
> java.lang.SecurityManager.checkRead(Unknown Source)
> java.io.File.exists(Unknown Source)
> org.apache.fop.fonts.FontCache.loadFrom(FontCache.java:142)
> org.apache.fop.fonts.FontCache.load(FontCache.java:132)
> org.apache.fop.fonts.FontManager.setUseCache(FontManager.java:121)
> org.apache.fop.fonts.FontManager.<init>(FontManager.java:63)
> org.apache.fop.apps.FopFactory$1.<init>(FopFactory.java:159)
> org.apache.fop.apps.FopFactory.<init>(FopFactory.java:156)
> org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:177)
> <....>
> when running FopFactory.newInstance()
>
> Well, it seems FontCache i assuming I have read-permission in the
> home-directory, which I have not on the server.
>
> I have two suggestions how to solve this problem,
> 1. In FontCache.loadFrom(File cacheFile),
> the "if (cacheFile.exists()) {"-statement could be moved to within the
> try-block.
> This will result in no cache read if one does not have read-permission in
> the home-dir.
>
> 2. Add read-permission-check in method "public static File
> getDefaultCacheFile(boolean forWriting)" and default back to temp-dir, as
> with write-permission.
>
> I guess the best would be to do both, that way if one does not even have
> read-permission in the temp-dir, no cache will be used/read.
>
> Also, since the exception is thrown when I create the FopFactory, I cannot
> change the font-cache. So I'm stuck.
>
> --
> View this message in context:
> http://old.nabble.com/Bug--Read-permission-of-FontCache-dir-file-is-assumed-tp29835851p29835851.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]