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

Hi,

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:block&gt;
    &lt;fo:external-graphic content-height="70"
src="url('file:c:///temp/my-image.png')" /&gt;
&lt;/fo:block&gt;
...


I get a

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


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
read)
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
com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(Unknown
Source)
	at MyXSLTemplate.template$dot$0()
	at MyXSLTemplate.applyTemplates()
	at MyXSLTemplate.applyTemplates()
	at MyXSLTemplate.transform()
	at
com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(Unknown
Source)
        ...
	at
com.transflow.cosa.portal.client.PortalClient$RunThread.run(PortalClient.java:422)
access: access allowed (java.security.SecurityPermission getPolicy)
access: domain that failed ProtectionDomain  (null )

com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl$TransletClassLoader@1573872
 &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
read)'
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
results...

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.

Mime
View raw message