cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

sci-chemistry/jmol-applet-12.3.14-r1: NullPointerException for plot3d in sage-notebook #302

Closed shuber2 closed 10 years ago

shuber2 commented 10 years ago

plot3d() in sage-notebook results in the following error message:

Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpHMF676/.jmol_images/sage0-size500.jmol.png', see
'$HOME/.sage/temp/$HOSTNAME/23587/tmp_wzZqVV.txt' for details

The txt file mentioned above contains:

1828 script command tokens
Interface.java Error creating instance for org.jmol.export.image.ImageCreator: 
org.jmol.export.image.ImageCreator
ERROR creating image: java.lang.NullPointerException
eval ERROR: ERROR creating image: java.lang.NullPointerException
----
         >> write << png "/tmp/tmpHMF676/.jmol_images/sage0-size500.jmol.png"

The reason for the instantiation error is that ImageCreator is not in JmolData.jar, which is called by sage/interfaces/jmoldata.py to create the png image in the first place. The reason for this is that in line 452 of build.xml of jmol-applet the org.jmol.export.* classes are explictily excluded when packaging the jar respective files.

However, when fixing this issue, plot3d() still does not work since the next NullPointerException occurs in org.jmol.g3d.Graphics3D.releaseBuffers(). The reason here is that platform is null, but still platform.releaseBuffers() is called. Fixing this however, just causes another NullPointerException in Graphics3D.beginRendering(), and here my motivation in bug hunting experienced a serious breakdown. I am not going to fix this software.

kiwifb commented 10 years ago

I am not blaming you. jmol is a pain in our backside. The problem is that upstream is just pulling more stuff we can't decently follow for lack of knowledgeable devs. We really are behind with what sage upstream is shipping now and will be further away in the future. Sage is currently at 12.3.27 while we stopped at 12.3.14 the last we could do without jspecview, which Steve finally got in the overlay but we haven't managed to make a jmol ebuild that could use it yet. In the meantime I would ask you if you could at least push the fix for installing the stuff we are missing. That puts us in a better position when and if we finally get past the current bottleneck.

shuber2 commented 10 years ago

The ticket http://trac.sagemath.org/ticket/12299 lists as new feature of jmol-12.3.27 to be able to initially display static images. This is exactly the feature which is failing here. To me, the trac ticket suggests that we need jmol-12.3.27 for this feature. (Which does not excuse the dirty programming of jmol.)

As a matter of fact, I was able to integrate jmol-12.3.27 and jmol-applet-12.3.27 here on my system. And, fortunately, this issue disappeared. I will clean up my stuff and send a pull request so you can comment on it.

kiwifb commented 10 years ago

You know that means you are officially our jmol person now :)

Your next mission if you accept it (and in your own time) will be to look at what upstream is doing at http://trac.sagemath.org/ticket/16003 (and to a lesser extent http://trac.sagemath.org/ticket/16004 ). The going is slow after a flurry of initial activity but it will hit us sooner rather than later.

Closing this issue.