right, that actually makes sense. In communicating with the applet,
particularly the signed applet, you have to be very careful about threads.
When you use jmolScript() you pass the command to one of two free-running
script processors within Jmol. Commands involving the JavaScript command
must run on one thread; commands doing any sort of file opening from
restricted domains must run on a thread special thread created at the time
the applet was created. When you use jmolScriptWait() you use the thread
that gave the command, and since that is of browser origin it does not have
the security rights of the signed applet.

So the lesson here is that one cannot use jmolScriptWait() to open files
with the signed applet, and one should always use callbacks if further
processing in that case is required. The note I have in the code reads:

  /*
   * CommandWatcher thread handles processing of
   * command scripts independently of the user thread.
   * This is important for the signed applet, where the
   * thread opening remote files cannot be the browser's,
   * and commands that utilize JavaScript must be the browser's.
   *
   * We need two threads for the signed applet, because commands
   * that involve JavaScript -- the "javascript" command or math
javascript() --
   * must run on a thread created by the thread generating the applet call.
   *
   * This CommandWatcher thread, on the other hand, is created by the applet
at
   * start up -- it can cross domains, but it can't run JavaScript.
   *
   *
   */



It's quite possible that there are methods of making all this work that I
just don't know of. But that's the way it is set up currently. I suspect
that someone with more Java experience could set this up so that the
JmolScriptWait() lets its thread sleep while the other processor is working.
Something like that.


Bob


On Sat, Aug 30, 2008 at 9:28 AM, Paul Pillot <
[EMAIL PROTECTED]> wrote:

> Thanks Bob,I narrowed down the problem to the jmolScriptWaitAsArray()
> function : surprisingly when I replace it by jmolScript(), I can load
> whatever file I want. On the contrary jmolScriptWaitAsArray() gives me
> access denial errors...
>
> Paul
>
> Le 30 août 08 à 15:07, Robert Hanson a écrit :
>
> Paul, check out this page to see how yours might be different.
>
> http://chemapps.stolaf.edu/jmol/docs/examples-11/simple.htm
>
> It's using the signed applet and working just fine. Maybe has to be newer
> than 11.6.RC8, but I don't think so. It should load files from the PDB using
> "load =xxxx" and files from your hard drive using, for example:
>
> load c:/temp/caffeine.xyz
>
>
> Also, the Jmol Protein Explorer is using using the signed applet without a
> hitch.
>
> Bob
>
>
>
> On Sat, Aug 30, 2008 at 7:32 AM, Paul Pillot <
> [EMAIL PROTECTED]> wrote:
>
>> I am setting up a web page with the ability to load local files as
>> well as external files (for example, files coming from the pdb)
>>
>> When I run the page locally, the applet is able to load any local
>> file, but sends an error message (Jmol 11.6.RC8, Mac OSX, Safari):
>> java.security.AccessControlException: access denied
>> (java.net.SocketPermission www.rcsb.org:80 connect,resolve)
>> openFile(http://www.rcsb.org/pdb/files/1gzx.pdb): 61 ms
>> eval ERROR: java.security.AccessControlException: access denied
>> (java.net.SocketPermission www.rcsb.org:80 connect,resolve)
>> ----line 1 command 1 of  file null:
>>          load >> "http://www.rcsb.org/pdb/files/1gzx.pdb"; <<
>>
>> When the page is loaded from a webserver, the applet is unable to
>> load any local file, as well as remote files coming from elsewhere
>> than the webserver :
>> FileManager.openFile(''file:////Users/paul/Desktop/
>> ac.pdb'') //''file:////Users/paul/Desktop/ac.pdb''
>> FileManager opening 
>> http://ordinateur-de-judith-ciosi.local/~paul/<http://ordinateur-de-judith-ciosi.local/%7Epaul/>
>> JMolUSc/''file:////Users/paul/Desktop/ac.pdb''
>> file ERROR: 
>> http://ordinateur-de-judith-ciosi.local/~paul/<http://ordinateur-de-judith-ciosi.local/%7Epaul/>
>> JMolUSc/''file:////Users/paul/Desktop/ac.pdb''
>> java.io.FileNotFoundException: http://ordinateur-de-judith-
>> ciosi.local/~paul/JMolUSc/''file:////Users/paul/Desktop/ac.pdb''
>> openFile(''file:////Users/paul/Desktop/ac.pdb''): 3 ms
>> eval ERROR: java.io.FileNotFoundException: http://ordinateur-de-
>> judith-ciosi.local/~paul/JMolUSc/''file:////Users/paul/Desktop/ac.pdb''
>> ----line 1 command 1 of  file null:
>>          load >> "''file:////Users/paul/Desktop/ac.pdb''" <<
>>
>> I searched the mailing list archive for this issue and found a one
>> year old thread, which stated that this behavior is linked to the
>> inability to accept loading external files when the command is issued
>> by an unsigned javascript. A workaround is to reload the jmol applet
>> with the new file.
>> I would like to know if there is any other solution to make the
>> signed applet accept an external file ? I am also wondering at how
>> this problem has been dealt with in jmol protein explorer ?
>>
>> Thanks in advance,
>> Paul
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Jmol-users mailing list
>> Jmol-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>
>
>
> --
> Robert M. Hanson
> Professor of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
>
> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to