jmol won't display

432 views
Skip to first unread message

David

unread,
Feb 6, 2012, 7:08:41 PM2/6/12
to sage-support
Hi all--

This has been driving me nuts. In firefox on two computers running
ubuntu 10.04, jmol plots do not appear, and I get this in the
javascript error console:

unterminated string literal
window.top.status='script compiler ERROR: command expected

Using chrome on the same machines, or the same version of firefox on
an ubuntu 11.04 machine I have no problem. I can view other jmol
instances (not in sage) just fine in firefox on the two problem
machines. In fact, I can take the same jmol output from sage and put
it as a standalone jmol applet on another server and firefox is happy.
Anyone run across this? Any ideas?

-- David

Jason Grout

unread,
Feb 6, 2012, 9:07:44 PM2/6/12
to sage-s...@googlegroups.com

Is this with sagenb.org? Or with 4.8 on a local machine? What happens
on sagenb.org and test.sagenb.org?

Thanks,

Jason

David

unread,
Feb 6, 2012, 9:56:06 PM2/6/12
to sage-support
It happens on sagenb.org 4.7.2 and on our internal 4.6 sage server.
I'll check the test server when I go to work tomorrow.

-- David

Jason Grout

unread,
Feb 6, 2012, 9:58:44 PM2/6/12
to sage-s...@googlegroups.com
On 2/6/12 8:56 PM, David wrote:
> It happens on sagenb.org 4.7.2 and on our internal 4.6 sage server.
> I'll check the test server when I go to work tomorrow.

Do you have the Sun Java installed, or the Iced Tea thing? IIRC, you
need to install the sun jdk; the iced tea version won't work. I know
others have dealt with java issues with jmol on ubuntu before (for
example, Dan Drake, if I recall correctly).

Thanks,

Jason

David

unread,
Feb 6, 2012, 10:38:37 PM2/6/12
to sage-support
I just tried test.sagenb.org on a 10.04 machine at home, same problem.
All machines are sun java, I think the latest version of java 1.6. I
have also tried turning off all firefox extensions, no help.

-- David

Jason Grout

unread,
Feb 6, 2012, 10:46:39 PM2/6/12
to sage-s...@googlegroups.com

Hmmm....You said you had an error message. Usually console error
messages include a line number, IIRC, and if you click on the line
number, it brings up the file in question. Do you see a line number for
the error, by chance?

Jason

David

unread,
Feb 6, 2012, 11:06:32 PM2/6/12
to sage-support
No line number. If I click on the url in the error I get the source,
but it just leaves me at the top.
Here's the error:

http://skink.whitman.edu/sage_error.png

David

unread,
Feb 6, 2012, 11:16:36 PM2/6/12
to sage-support
More information: I get a black square where the jmol figure should
be, and the jmol menus are active.

-- David

Jason Grout

unread,
Feb 6, 2012, 11:25:35 PM2/6/12
to sage-s...@googlegroups.com


Hmmm. Double Hmmm...

Here's a possible cause:
http://stackoverflow.com/questions/227552/common-sources-of-unterminated-string-literal

Here's an idea: jmol is launched via javascript that is sent to the
browser. That javascript is eval'd in the browser. Somewhere in that
javascript that is sent to the browser, there is some sort of problem.

Here's one way to diagnose if this is the problem. In
SAGE_ROOT/devel/sagenb/sagenb/data/sage/js/notebook_lib.js, modify the
eval_script_tags function to log the string it eval()'s. (In other
words, put console.log(code) just above eval(code) in that function).
Then we can see exactly what code is being evaluated. There are a few
other places that code is evaled, but my guess is that it is in the
eval_script_tags function.

Do other javascript things work? For example, does shift-enter evaluate
a cell?

Thanks,

Jason


Dan Drake

unread,
Feb 7, 2012, 7:03:32 AM2/7/12
to sage-s...@googlegroups.com
On Mon, 06 Feb 2012 at 08:58PM -0600, Jason Grout wrote:
> Do you have the Sun Java installed, or the Iced Tea thing? IIRC,
> you need to install the sun jdk; the iced tea version won't work. I
> know others have dealt with java issues with jmol on ubuntu before
> (for example, Dan Drake, if I recall correctly).

IcedTea would almost/sorta/kinda work for me -- sometimes. I've since
just installed Oracle Java. I almost think we should explicitly not
support the IcedTea plugin, since it doesn't seem to actually work
properly.

Dan

--
--- Dan Drake
----- http://mathsci.kaist.ac.kr/~drake
-------

signature.asc

David

unread,
Feb 7, 2012, 11:40:41 AM2/7/12
to sage-support
Here's the console with the trace. I added a "starting ..." message at
the beginning of the function, then the trace.

http://skink.whitman.edu/sage_error_2.png

-- David

David

unread,
Feb 7, 2012, 11:56:48 AM2/7/12
to sage-support
Oh, and yes, "shift return" works fine.

Jason Grout

unread,
Feb 7, 2012, 12:49:11 PM2/7/12
to sage-s...@googlegroups.com, Jonathan Gutow

In trying to diagnose this, I noticed another error. Apparently on
sagenb.org, creating a 3d plot tries to load a file that gives a 404.
I'm CCing Jonathan Gutow, who likely can figure out the problem.

Jonathan: sagenb.org has the new jmol from trac #11503 installed (as
well as the other things from #11080). It should be able to find the
java applet in /java/jmol/JmolApplet0.jar. If you create a new
worksheet and try a 3d plot, though, my browser gives a warning of a 404
when trying to load:

http://sagenb.org/home/jason3/543/JmolApplet

You can see at the top of the worksheet page that jmolInitialize is
called with the /java/jmol path. Why is Sage trying to load the URL above?

Thanks,

Jason

Jason Grout

unread,
Feb 7, 2012, 12:51:43 PM2/7/12
to sage-s...@googlegroups.com, Jonathan Gutow

Note that even with the above error, though, the 3d plot is loading
fine. Maybe the JmolApplet.jar is cached for me?

Jason

David

unread,
Feb 7, 2012, 1:19:53 PM2/7/12
to sage-support
I've played around with jmol_applet a bit now, and the problem seems
to be when jmol's jmolApplet is called, probably with the "script"
string as an argument. The firefox I'm running was distributed by
canonical, so it's entirely possible they screwed something up in
10.04 that is ok in 11.04. I may just have to upgrade, and use chrome
until I do.

-- David

Jason Grout

unread,
Feb 7, 2012, 1:23:59 PM2/7/12
to sage-s...@googlegroups.com

What if you change jmol_applet so that the jmolApplet line looks like:

jmolApplet(size, "scri"+"pt " + url, jmol_count);


That avoids the text "script" appearing as a single word; maybe that
would help? It's a shot in the dark, but it's one way to solve this
sort of problem if you have "</script>" in your javascript code.

Jason

David

unread,
Feb 7, 2012, 1:28:42 PM2/7/12
to sage-support
That's one of the things I tried. But now I think something deeper is
going on: it appears from the jmol docs that "source" is a synonym for
"script", so I tried that. Firefox throws the same error, including
the word "script". Chrome works fine. So the problem may be down in
jmolApplet? Anyway, if it's canonical's fault it may be pointless to
go on. I might try doing an install of firefox straight from mozilla
and see what happens.

-- David

Jason Grout

unread,
Feb 7, 2012, 1:31:22 PM2/7/12
to sage-s...@googlegroups.com

Okay; thanks for taking the time to try to diagnose the problem. I wish
I could replicate it.

Jason

David

unread,
Feb 7, 2012, 1:46:14 PM2/7/12
to sage-support
Well, the mystery persists. The stock firefox direct from mozilla has
the same problem. Maybe it really is a 10.04 library.

-- David

Jason Grout

unread,
Feb 7, 2012, 1:49:12 PM2/7/12
to Gutow, Jonathan H, sage-s...@googlegroups.com
On 2/7/12 12:44 PM, Gutow, Jonathan H wrote:
> Unfortunately, I only have time for lunch between classes today. I
> won't be able to do any real digging until this evening (and then
> little as I have and early lecture to give). But I can confirm that
> the Jmol applet does not get the correct data until a recalculate is
> done. Once I reexecute the calculation cell things seem to run fine
> for me. I wonder if the issue is with the time based unique naming
> scheme?
>
> If it is an issue of re-evaluating the cell after an upgrade, I'm not
> sure we can call this a bug, but I will need to dig further.
>

Thanks for looking at this, when you have time, of course.

Jason

David

unread,
Feb 8, 2012, 7:18:52 PM2/8/12
to sage-support
After playing around in the jmol console, and getting a weird error
involving DOCTYPE, I found some old info on the web, including from
Jonathan. I couldn't find a fix in a few minutes, but someone
speculated that it was a cookie thing. Bingo. I turned on third party
cookies, and it instantly worked. I can't see any extra cookies being
set though; very mysterious. I'm not so keen on allowing third party
cookies, so I turned it off and added an explicit "allow" for cookies
from our internal server, and it still works. I don't think I really
understand what's going on...

I'll check sagenb.org now, but I expect it will be fine.

-- David

David

unread,
Feb 8, 2012, 7:22:49 PM2/8/12
to sage-support
Ah, presumably the whole ubuntu 10.04 thing is a red herring; I must
be accepting 3rd party cookies on the 11.04 machine. I'll check it
when I get home.

-- David

Jason Grout

unread,
Feb 8, 2012, 10:52:01 PM2/8/12
to sage-s...@googlegroups.com

Great! I remember running into a cookie issue that Mike Hansen
essentially solved for us last March. I wonder if it was the same issue.

Jonathan: do you know what this third party cookies issue is about?

Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages