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 Vincent Hardy <vi...@sun.com> on 2002/01/30 03:24:55 UTC

Re: Webstart and Squiggle

Hello Cory,

Sorry, it did not click the first time: I did fix the RhinoClassLoader 
since 1.5beta4 to address that very issue (now the RhinoClassLoader 
properly delegates to its parent before trying anything). If you get the 
lastest CVS version, you should be able to run your ECMA scripts with 
JavaWebStart.

Vincent.

Cory Sanoy wrote:
> The js.jar is in the path and 'all-permissions' is specified in the jnlp
> file. 
> 
> There are issues with classloaders
> (http://java.sun.com/products/javawebstart/faq.html#54) in the security
> mechanism employed by webstart. The documentation states (in the link above)
> that the classloader user to load the classes must be the one that loaded
> the application (Thread.getCurrent().getContextClassLoader()). 
> 
> I think the RhinoClassLoader is not using the classloader that loaded the
> application and therefore webstart cannot find the
> org/mozilla/javascript/NativeScript class in the jnlp file? Has anyone found
> a fix for this???
> 
> Here is the jnlp file that I am using: 
> 
> <?xml version="1.0" encoding="utf-8"?>
>       <!-- JNLP File for Squiggle SVG Browser Application -->  
>       
>       <jnlp
>         spec="1.0+"
>         codebase="http://webserver/lib"
>         href="squiggle.jnlp">
>         <information>
>           <title>Squiggle</title>
>           <vendor>Smart</vendor>
>           <homepage href="http://webserver/"/>
>           <description>Squiggle</description>
>           <icon href="images/batik.jpg"/>
>           <offline-allowed/>
>         </information>
>         <security>
>           <all-permissions/>
>         </security>
>         <resources>
>           <j2se version="1.4"/>
>           <jar href="lib/batik-squiggle.jar"/>
>           <jar href="lib/batik-ext.jar"/>
>           <jar href="lib/batik-util.jar"/>
>           <jar href="lib/batik-awt-util.jar"/>
>           <jar href="lib/batik-gui-util.jar"/>
>           <jar href="lib/batik-dom.jar"/>
>           <jar href="lib/batik-css.jar"/>
>           <jar href="lib/batik-svg-dom.jar"/>
>           <jar href="lib/batik-swing.jar"/>
>           <jar href="lib/batik-gvt.jar"/>
>           <jar href="lib/batik-parser.jar"/>
>           <jar href="lib/batik-script.jar"/>
>           <jar href="lib/batik-transcoder.jar"/>
>           <jar href="lib/batik-bridge.jar"/>
>           <jar href="lib/batik-xml.jar"/>
>           <jar href="lib/crimson-parser.jar"/>
>           <jar href="lib/js.jar"/>
>         </resources>
>         <application-desc
> main-class="org.apache.batik.apps.svgbrowser.Main">
> 				<argument>-font-size</argument>
> 				  <argument>16</argument>
> 	
> <argument>http://webserver/samples/filecontainingjavascript.svg</argument>
> 			</application-desc>
>       </jnlp>
>       
>   
> Thanks again,
> /Cory   
>   
> 
> 
> 
> 
> -----Original Message-----
> From: Vincent Hardy [mailto:vincent.hardy@sun.com]
> Sent: Wednesday, January 29, 2003 11:49 AM
> To: Batik Users
> Cc: Cory Sanoy; 'thomas.deweese@kodak.com'
> Subject: Re: Webstart and Squiggle
> 
> 
> Hello Cory,
> 
> If you want to run JavaScript under WebStart, you need to grant special 
> permissions to your WebStart application. I assume that you have js.jar 
> in your classpath as I see some org.mozilla.javascript code in the stack 
> trace.
> 
> Try something like:
> 
>    <security>
>        <all-permissions/>
>    </security>
> 
> in your JNLP file.
> Vincent.
> 
> Thomas E Deweese wrote:
> 
>>>>>>>"CS" == Cory Sanoy <Co...@smarttech.com> writes:
>>>>>>
>>CS> I am attempting to launch squiggle with Java Web Start and when I
>>CS> load an SVG file that contains javascript code I get the following
>>CS> error:
>>
>>CS> java.lang.NoClassDefFoundError:
>>CS> org/mozilla/javascript/NativeScript at
>>
>>    You probably don't hav js.jar on the class path.  This is where
>>the javascript interpreter lives.
>>
>>CS> java.lang.ClassLoader.defineClass0(Native Method) at
>>CS> java.lang.ClassLoader.defineClass(Unknown Source) at
>>CS> java.security.SecureClassLoader.defineClass(Unknown Source) at
>>CS> org.apache.batik.script.rhino.RhinoClassLoader.defineClass(Unknown
>>CS> Source) at
>>CS> org.apache.batik.script.rhino.BatikSecuritySupport.defineClass(Unknown
>>CS> Source) at
>>CS> org.mozilla.javascript.optimizer.Codegen.compile(Unknown Source)
>>CS> at org.mozilla.javascript.Context.compile(Unknown Source) at
>>CS> org.mozilla.javascript.Context.compile(Unknown Source) at
>>CS> org.mozilla.javascript.Context.compileReader(Unknown Source) at
>>CS> org.mozilla.javascript.Context.evaluateReader(Unknown Source) at
>>CS> org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown
>>CS> Source)
>>
>>CS> at
>>CS> org.apache.batik.script.rhino.RhinoInterpreter.bindObject(Unknown
>>CS> Source)
>>
>>CS> at
>>CS>
> 
> org.apache.batik.bridge.BaseScriptingEnvironment.initializeEnvironment(Unkno
> 
>>CS> wn Source) at
>>CS> org.apache.batik.bridge.BaseScriptingEnvironment.loadScripts(Unknown
>>CS> Source) at
>>CS> org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown
>>CS> Source) at
>>CS> org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown
>>CS> Source)
>>
>>CS> I am using batik 1.5 beta 4 and Java 1.4 and/or 1.3. I have read
>>CS> some discussions items that define the issue and I understand the
>>CS> source of the problem. However I have yet to find a solution to
>>CS> the problem. Has anyone solved the problem and if so how? Is there
>>CS> a quick fix?
>>
>>CS> Thanks, /Cory
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 



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