logo       

Re: problem calling custom java class from ecmascript: msg#00159

Subject: Re: problem calling custom java class from ecmascript
Jeffrey Hau wrote:

I am just starting with batik and try to run a very simple script within a SVG document. The script is just the function below,

function callJava() {
     var cx = Packages.org.mozilla.javascript.Context.enter();
     alert(cx);
}

Hi Jeffrey,

   We don't allow access to this class from javascript for
security reasons.  I just noticed that there this is not controlled
(as it should be) by the User Agent security settings, so the
only way to work around this would be to modify the Batik sources
(in particular either modify batik.script.rhino.RhinoClassShutter
 or RhinoInterpreter so it never registers a class shutter).

but when i run this within the squiggle browser, i get the following  error

TypeError: [JavaPackage org.mozilla.javascript.Context.enter] is not a function. (Inline <script> file:/Projects/svg/lines.svg:6; line 3) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java: 597) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java: 557) at org.mozilla.javascript.NativeGlobal.typeError1(NativeGlobal.java:567)
    at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1182)

(rest of the trace omitted)

the code execute ok within the standalone rhino shell, so i think this is probably a classpath setting problem.
i try runnning the browser in the batik installation directory by

java -jar batik-squiggle.jar

and also (as a user suggested in an earlier post),

java -cp batik-squiggle.jar:lib/js.jar org.apache.batik.apps.svgbrowser.Main

but neither works, can anyone help?

thanks very much

Jeff


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe