Hi Thierry,
  I have come back to fight with this bug again.

Attached is a zip file containing java source, svg, certificates
and an ant build.xml to test the applet.  It is designed to be
unpacked into xml-batik directory where it sets up both an applet
and application and signs the applet jars.  The README file has
a brief explanation.

CanvasTest.svg essentially does

m_canvas = new JSVGCanvas();
m_canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
m_canvas.setURI(uri);

It also creates a NativeScript() object just to prove it is in my
classpath.  The applet fails, under 1.3.1 and 1.4.1 with 


========================== 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)
...


My understanding is this error occurs when the class is not in the classpath
or when it is not appropriately signed.  I suspect
org.mozilla.javascript.gen.c1 extends NativeScript and so the
RhinoClassLoader attempts to load that also but fails because either the
certificates in the RhinoClassLoader are different from js.jar or it does
not have permission to load js.jar because only the AppletClassLoader can do
that.

Either way it looks intractable.  I considered having RhinoClassLoader
delegate to the SystemClassLoader but defineClass() is a protected method
and it is illegal to extend (or create a classloader from)
AppletClassLoader.  My only option appears to be checking out a copy of
Batik 1.1.1 and trying to splice its javascript facilities (which worked as
an applet) into 1.5.  Not a preferred option.

I'll go file this officially in bugzilla now.

Gavin Walker

[EMAIL PROTECTED]                        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



-----Original Message-----
From: Thierry Kormann [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 5 November 2002 8:49 PM
To: Batik Users
Subject: RE: Dynamic batik in applet



>   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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Attachment: apptest.zip
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to