xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dahepe <pe...@gmx.net>
Subject Using <fo:external-graphic ... /> in applet
Date Thu, 03 Dec 2009 15:47:07 GMT


I'm trying to integrate FOP in a client side application that is made
available as applet/java webstart application. The integration works well
but I'm not able to use the &lt;fo:external-graphic ... /&gt; tag to embed
image files into the generated PDF. When trying to embed an image using the
following directive

    &lt;fo:external-graphic content-height="70"
src="url('file:c:///temp/my-image.png')" /&gt;

I get a

access: access denied (java.io.FilePermission file:c:\temp\my-image.png

on the Java console. Enabling security debug output (Runtime parameter
-Djava.security.debug=access:failure) yielded the following details
(complete output:  http://old.nabble.com/file/p26628106/fop-stacktrace.log
fop-stacktrace.log )

access: access denied (java.io.FilePermission file:c:\temp\my-image.png
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Unknown Source)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkRead(Unknown Source)
	at java.io.File.canRead(Unknown Source)
	at MyXSLTemplate.template$dot$0()
	at MyXSLTemplate.applyTemplates()
	at MyXSLTemplate.applyTemplates()
	at MyXSLTemplate.transform()
access: access allowed (java.security.SecurityPermission getPolicy)
access: domain that failed ProtectionDomain  (null )

 &lt;no principals&gt;
 java.security.Permissions@96d2c2 (
 (java.util.PropertyPermission line.separator read)
 (java.net.SocketPermission localhost:1024- listen,resolve)
 (java.lang.RuntimePermission stopThread)

FEHLER:  'access denied (java.io.FilePermission file:c:\temp\my-image.png
Fehler in write: java.security.AccessControlException: access denied
(java.io.FilePermission file:c:\temp\my-image.png read)

For me this looks like xalan dynamically generates a class for my XSL
template (MyXSLTemplate) and this class tries to access the external file.
The application is running with a security manager (applet/web start) and
this class does not have the permission to access the file as it is not
signed (unlike the rest of the application).

The file location (locally HD or on a web server) doesn't seem to matter as
the error is always the same...

Is this problem already known and is there a possible solution/workaround
for this? Can't image I'm the first one to try to embed an external graphic
using FOP in an applet context, but search didn't give my any usable

Java version: JRE 1.6.0_17

FOP version: 0.94

Best regards

View this message in context: http://old.nabble.com/Using-%3Cfo%3Aexternal-graphic-...--%3E-in-applet-tp26628106p26628106.html
Sent from the FOP - Users mailing list archive at Nabble.com.

View raw message