Jim, I think you are just not initializing Jmol quite correctly. This is
probably the first time anyone has created the applet within another applet.
We might have to set something special up for that. Somehow you have to get
the "-applet" tag into the commandLineOptions.

Let's see. What do I know... You are using JmolViewer.allocateViewer. Good.
The method is:

 static public JmolViewer allocateViewer(Component awtComponent,
                                          JmolAdapter jmolAdapter,
                                          String htmlName, URL documentBase,

                                          URL codeBase,
                                          String commandOptions,
                                          JmolStatusListener statusListener)

What are you sending for commandOptions? If "-applet" is not there, then you
need to add that. I think you want at the very least:


String fullname = htmlName + "__" + Math.random() + "__";

JmolViewer viewer = JmolViewer.allocateviewer(yourApplet, null, fullName,
documentBase, codeBase, "-applet", null)

The reason for the unique applet name is so that all the applets in a given
session have unique IDs. Mostly this just relates to synchronization, but
then also you can test to make sure that specific applets are really
unloaded when the page closes -- and you don't have a memory leak in your
applet somewhere.


Bob







On Fri, Aug 20, 2010 at 9:25 AM, Jim Procter
<jproc...@compbio.dundee.ac.uk>wrote:

>
> Hi all.
>
> I'm currently updating the version of Jmol used by Jalview to the 12.x
> branch, and have run into an unexpected permissions problem when
> launching Jmol from the Jalview applet. Try the two versions of
> JalviewLite on this page:
>
>
> http://www.compbio.dundee.ac.uk/user/ws-dev1/jalview/latest/applet/testJmol12.html
>
> One starts JalviewLite with its build in PDB viewer - just to show that
> the data is present and accessible.The other starts JalviewLite with
> Jmol 12.0.6 - and for machines I have access to, it generates the
> following exception:
>
> java.security.AccessControlException: access denied
> (java.util.PropertyPermission user.dir read)
>     at java.security.AccessControlContext.checkPermission(Unknown Source)
>     at java.security.AccessController.checkPermission(Unknown Source)
>     at java.lang.SecurityManager.checkPermission(Unknown Source)
>     at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
>     at java.lang.System.getProperty(Unknown Source)
> <platform dep lines here>
>     at java.io.File.getAbsolutePath(Unknown Source)
>     at org.jmol.viewer.FileManager.classifyName(Unknown Source)
>     at org.jmol.viewer.FileManager.getDefaultDirectory(Unknown Source)
>     at org.jmol.viewer.Viewer.cd(Unknown Source)
>     at org.jmol.viewer.Viewer.setAppletContext(Unknown Source)
>     at org.jmol.viewer.Viewer.allocateViewer(Unknown Source)
>     at org.jmol.api.JmolViewer.allocateViewer(Unknown Source)
>     at
>
> jalview.ext.jmol.JalviewJmolBinding.allocateViewer(JalviewJmolBinding.java:1068)
>     at jalview.appletgui.AppletJmol.<init>(AppletJmol.java:183)
>     at jalview.appletgui.AlignFrame.newStructureView(AlignFrame.java:3307)
>     at
> jalview.bin.JalviewLite$LoadingThread.startLoading(JalviewLite.java:985)
>     at jalview.bin.JalviewLite$LoadingThread.run(JalviewLite.java:728)
>
> The text prior to the exception is generated by JalviewLite when it
> receives the exception:
> Couldn't create a jmol viewer. Args to allocate viewer were:
> DocumentBase=
> http://www.compbio.dundee.ac.uk/user/ws-dev1/jalview/latest/applet/testJmol12.html
> Codebase=
> http://www.compbio.dundee.ac.uk/user/ws-dev1/jalview/latest/applet/
>
> Unfortunately, this has me stumped for the moment. Any ideas what I
> might be doing wrong, or is this actually a bug ?  The JalviewLite/Jmol
> combination works fine under the appletviewer (which doesn't have the
> same sandbox constraints), and the Jalview desktop application is now
> also playing nice with version 12, so whilst I think I'm initing Jmol
> correctly, it still wants to try to access the client machine's file
> system - even when it isn't allowed to.
>
> cheers.
> Jim.
>
> --
> -------------------------------------------------------------------
> J. B. Procter  (JALVIEW/ENFIN)  Barton Bioinformatics Research Group
> Phone/Fax:+44(0)1382 388734/345764  http://www.compbio.dundee.ac.uk
> The University of Dundee is a Scottish Registered Charity, No. SC015096.
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to