You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Ga...@csiro.au on 2002/11/01 03:32:45 UTC

Dynamic batik in applet

Hi,
  We have been using Batik in a signed applet and using simple
scripting in the svg document.  This was satisfactory under 
Batik 1.1.1.  Under 1.5 things fall over.  Our code can be run
as an applet or application and essentially does:

canvas = new JSVGCanvas();
canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
uri = getClass().getClassLoader().getResource("test.svg").toExternalForm();
canvas.setURI(uri);

Where test.svg is in a signed jar file and contains

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
"http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd"
>
<svg width="100%" height="100%" viewBox="0 0 1.46666666666667 1">
<script type="text/ecmascript">
  function select(model,evt) {
    System.out.println("Hi!!");
  }
</script>
<title>SVG drawing</title>
<g transform="rotate(90) scale(1,-1) scale(0.0017361) " xml:space="preserve"
style="stroke:black;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterli
mit:10.433;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;fill:n
one;fill-opacity:1;font-style:normal;font-variant:normal;font-weight:normal;
font-stretch:normal;font-size-adjust:none;letter-spacing:normal;word-spacing
:normal;text-anchor:start;">
<g onclick="select('soil4',evt)">
<polygon points="225.59,562.66 261.5,562.66 261.5,662.41 225.59,662.41 "
style="stroke:#f0e68c;stroke-width:0;fill:#f0e68c;fill-rule:nonzero;"/>
</g>
</g>
</svg>

This works fine as an application.  As an applet we get an exception under
plugin 1.3.1 and 1.4.1_01 (1.4.0 just used to hang the thread).  Any help
with what is going on here?  js.jar, which contains NativeScript, is in the
applet classpath (ARCHIVE_VALUE or JAVA_ARCHIVE).

Thank you 

Gavin 

Gavin.Walker@csiro.au                        Computer Scientist
CSIRO Mathematical and Information Sciences  Internet Marketplaces
GPO Box 664                                  tel: +61 2 6216 7030
CANBERRA  ACT  2601   AUSTRALIA              fax: +61 2 6216 7111



RimisCanvasTest applet started

========================== Rhino loader code source is :
jar:file:/D:/cygwin/home/gavin/test_rimis/rimis/applications/epss/applet/tes
tCanvas.jar!/resources/svg/testICT.svg <no certificates>)

========================== Trying to load : org.mozilla.javascript.gen.c1

java.lang.NoClassDefFoundError: org/mozilla/javascript/NativeScript

	at java.lang.ClassLoader.defineClass0(Native Method)

	at java.lang.ClassLoader.defineClass(Unknown Source)

	at java.security.SecureClassLoader.defineClass(Unknown Source)

	at
org.apache.batik.script.rhino.RhinoClassLoader.defineClass(Unknown Source)

	at
org.apache.batik.script.rhino.BatikSecuritySupport.defineClass(Unknown
Source)

	at
org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:124)

	at org.mozilla.javascript.Context.compile(Context.java:1810)

	at org.mozilla.javascript.Context.compile(Context.java:1735)

	at org.mozilla.javascript.Context.compileReader(Context.java:852)

	at org.mozilla.javascript.Context.evaluateReader(Context.java:770)

	at org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown
Source)

	at org.apache.batik.script.rhino.RhinoInterpreter.bindObject(Unknown
Source)

	at
org.apache.batik.bridge.BaseScriptingEnvironment.initializeEnvironment(Unkno
wn Source)

	at
org.apache.batik.bridge.BaseScriptingEnvironment.loadScripts(Unknown Source)

	at
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source)

	at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown
Source)

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: Dynamic batik in applet

Posted by Thierry Kormann <tk...@ilog.fr>.
>   We have been using Batik in a signed applet and using simple
> scripting in the svg document.  This was satisfactory under
> Batik 1.1.1.  Under 1.5 things fall over.  Our code can be run
> as an applet or application and essentially does:

> This works fine as an application.  As an applet we get an exception under
> plugin 1.3.1 and 1.4.1_01 (1.4.0 just used to hang the thread).  Any help
> with what is going on here?  js.jar, which contains NativeScript,
> is in the
> applet classpath (ARCHIVE_VALUE or JAVA_ARCHIVE).


looks like a security issue. Vincent is the right guy for that.
Don't you have a way to turn security on/off through APIs ?

Thierry.



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org