Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-21 Thread Jonathan Gutow
I was able to successfully embed it in the SAGE web server.  Now for lots of 
code cleanup...

Jonathan
On Mar 20, 2012, at 7:43 PM, Robert Hanson wrote:

 OK, so I definitely learned something! 
 
 On Tue, Mar 20, 2012 at 5:48 PM, Jonathan Gutow gu...@uwosh.edu wrote:
 Bob,
 
 You did it!  My preliminary tests show it works.  I have to do some 
 modifications to get it embedded in Sage, but I think it will work fine.
 
 Thanks,
 Jonathan
 
 On Mar 19, 2012, at 9:53 PM, Robert Hanson wrote:
 
 OK, Jonathan. I think I found the problem. Please try what I just checked in 
 -- do a build, and then use jmolData.jar instead of jmol.jar.  
 
 Formerly:
 
 JmolData.jar  -s foo.spt

execute the script foo.spt with absolutely no graphics and no rendering, 
 including no image creation
 
 now:
 
 JmolData.jar -s foo.spt
 
execute the script foo.spt still with rending for image creation, just 
 not for screen display
 
 Jmoldata.jar -n -s foo.spt
 
   as before, now for performance enhancement, no graphics of any kind.
 
 Let's see how that works. 
 
 Bob
 
 
 On Mon, Mar 19, 2012 at 8:30 PM, Robert Hanson hans...@stolaf.edu wrote:
 If awt is not there, you are out of luck. But with the -n flag there is no 
 creation of Display. But there might be a reference to it. Let me see. Based 
 on this discussion: 
 http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/  we 
 should be able to do it. 
 
 Bob
 
 
 On Mon, Mar 19, 2012 at 6:06 PM, Jonathan Gutow gu...@uwosh.edu wrote:
 Bob,
 
 Thanks for trying...Your changes definitely reduce the error messages, but 
 the application is still looking for screen dimensions somewhere in the tree 
 after entering JmolPanel.  It is making a call to the awt package. I'm 
 suspicious this is all associated with the allocation of a Display near line 
 242 in JmolPanel.
 
 I've got a solution for Sage, but we should keep picking at this as more 
 people would be able to use Jmol as a server side image generator.  Some 
 people really don't like running a GUI on their servers.
 
 Jonathan
 On Mar 19, 2012, at 3:51 PM, Robert Hanson wrote:
 
 Could be I'm wrong.Try what I just checked in. Be sure to use the 
 
 -ions t.spt
 
 option (silent/no console/no graphics)
 
 You  won't get THAT error. but will it create an image? I used this script:
 
 load $tylenol
 write image 300 300 t.png
 
 
 Bob
 
 
 On Mon, Mar 19, 2012 at 7:55 AM, Gutow, Jonathan H gu...@uwosh.edu wrote:
 I dug a little and agree it would be a significant undertaking to make the 
 image generation work without the GUI.  That said, we might want to put 
 that on a long term to-do list.
 
  
 -- 
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers
 
 
  Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 UW-Oshkosh  Office: 920-424-1326
 800 Algoma BoulevardFAX:920-424-2042
 Oshkosh, WI 54901
 http://www.uwosh.edu/facstaff/gutow
 
 
 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 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
 
 
 
 -- 
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers 

Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-21 Thread Robert Hanson
superb!

On Wed, Mar 21, 2012 at 11:26 AM, Jonathan Gutow gu...@uwosh.edu wrote:

 I was able to successfully embed it in the SAGE web server.  Now for lots
 of code cleanup...

 Jonathan

 On Mar 20, 2012, at 7:43 PM, Robert Hanson wrote:

 OK, so I definitely learned something!

 On Tue, Mar 20, 2012 at 5:48 PM, Jonathan Gutow gu...@uwosh.edu wrote:

 Bob,

 You did it!  My preliminary tests show it works.  I have to do some
 modifications to get it embedded in Sage, but I think it will work fine.

 Thanks,
 Jonathan

 On Mar 19, 2012, at 9:53 PM, Robert Hanson wrote:

 OK, Jonathan. I think I found the problem. Please try what I just checked
 in -- do a build, and then use jmolData.jar instead of jmol.jar.

 Formerly:

 JmolData.jar  -s foo.spt

execute the script foo.spt with absolutely no graphics and no
 rendering, including no image creation

 now:

 JmolData.jar -s foo.spt

execute the script foo.spt still with rending for image creation, just
 not for screen display

 Jmoldata.jar -n -s foo.spt

   as before, now for performance enhancement, no graphics of any kind.

 Let's see how that works.

 Bob


 On Mon, Mar 19, 2012 at 8:30 PM, Robert Hanson hans...@stolaf.eduwrote:

 If awt is not there, you are out of luck. But with the -n flag there is
 no creation of Display. But there might be a reference to it. Let me see.
 Based on this discussion:
 http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
 we should be able to do it.

 Bob


 On Mon, Mar 19, 2012 at 6:06 PM, Jonathan Gutow gu...@uwosh.edu wrote:

 Bob,

 Thanks for trying...Your changes definitely reduce the error messages,
 but the application is still looking for screen dimensions somewhere in the
 tree after entering JmolPanel.  It is making a call to the awt package. I'm
 suspicious this is all associated with the allocation of a Display near
 line 242 in JmolPanel.

 I've got a solution for Sage, but we should keep picking at this as
 more people would be able to use Jmol as a server side image generator.
  Some people really don't like running a GUI on their servers.

 Jonathan
 On Mar 19, 2012, at 3:51 PM, Robert Hanson wrote:

 Could be I'm wrong.Try what I just checked in. Be sure to use the

 -ions t.spt

 option (silent/no console/no graphics)

 You  won't get THAT error. but will it create an image? I used this
 script:

 load $tylenol
 write image 300 300 t.png


 Bob


 On Mon, Mar 19, 2012 at 7:55 AM, Gutow, Jonathan H gu...@uwosh.eduwrote:

 I dug a little and agree it would be a significant undertaking to make
 the image generation work without the GUI.  That said, we might want to 
 put
 that on a long term to-do list.



 --
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers


   Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 UW-Oshkosh  Office:
 920-424-1326
 800 Algoma BoulevardFAX:920-424-2042
 Oshkosh, WI 54901
 http://www.uwosh.edu/facstaff/gutow



 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 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




 --
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 

Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-20 Thread Jonathan Gutow
Bob,

You did it!  My preliminary tests show it works.  I have to do some 
modifications to get it embedded in Sage, but I think it will work fine.

Thanks,
Jonathan
On Mar 19, 2012, at 9:53 PM, Robert Hanson wrote:

 OK, Jonathan. I think I found the problem. Please try what I just checked in 
 -- do a build, and then use jmolData.jar instead of jmol.jar.  
 
 Formerly:
 
 JmolData.jar  -s foo.spt

execute the script foo.spt with absolutely no graphics and no rendering, 
 including no image creation
 
 now:
 
 JmolData.jar -s foo.spt
 
execute the script foo.spt still with rending for image creation, just not 
 for screen display
 
 Jmoldata.jar -n -s foo.spt
 
   as before, now for performance enhancement, no graphics of any kind.
 
 Let's see how that works. 
 
 Bob
 
 
 On Mon, Mar 19, 2012 at 8:30 PM, Robert Hanson hans...@stolaf.edu wrote:
 If awt is not there, you are out of luck. But with the -n flag there is no 
 creation of Display. But there might be a reference to it. Let me see. Based 
 on this discussion: 
 http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/  we 
 should be able to do it. 
 
 Bob
 
 
 On Mon, Mar 19, 2012 at 6:06 PM, Jonathan Gutow gu...@uwosh.edu wrote:
 Bob,
 
 Thanks for trying...Your changes definitely reduce the error messages, but 
 the application is still looking for screen dimensions somewhere in the tree 
 after entering JmolPanel.  It is making a call to the awt package. I'm 
 suspicious this is all associated with the allocation of a Display near line 
 242 in JmolPanel.
 
 I've got a solution for Sage, but we should keep picking at this as more 
 people would be able to use Jmol as a server side image generator.  Some 
 people really don't like running a GUI on their servers.
 
 Jonathan
 On Mar 19, 2012, at 3:51 PM, Robert Hanson wrote:
 
 Could be I'm wrong.Try what I just checked in. Be sure to use the 
 
 -ions t.spt
 
 option (silent/no console/no graphics)
 
 You  won't get THAT error. but will it create an image? I used this script:
 
 load $tylenol
 write image 300 300 t.png
 
 
 Bob
 
 
 On Mon, Mar 19, 2012 at 7:55 AM, Gutow, Jonathan H gu...@uwosh.edu wrote:
 I dug a little and agree it would be a significant undertaking to make the 
 image generation work without the GUI.  That said, we might want to put that 
 on a long term to-do list.
 
  
 -- 
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers
 
 
  Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 UW-Oshkosh  Office: 920-424-1326
 800 Algoma BoulevardFAX:920-424-2042
 Oshkosh, WI 54901
 http://www.uwosh.edu/facstaff/gutow
 
 
 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 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
 
 
 
 -- 
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers

 Dr. Jonathan H. Gutow
Chemistry Departmentgu...@uwosh.edu
UW-Oshkosh  

Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-20 Thread Robert Hanson
OK, so I definitely learned something!

On Tue, Mar 20, 2012 at 5:48 PM, Jonathan Gutow gu...@uwosh.edu wrote:

 Bob,

 You did it!  My preliminary tests show it works.  I have to do some
 modifications to get it embedded in Sage, but I think it will work fine.

 Thanks,
 Jonathan

 On Mar 19, 2012, at 9:53 PM, Robert Hanson wrote:

 OK, Jonathan. I think I found the problem. Please try what I just checked
 in -- do a build, and then use jmolData.jar instead of jmol.jar.

 Formerly:

 JmolData.jar  -s foo.spt

execute the script foo.spt with absolutely no graphics and no
 rendering, including no image creation

 now:

 JmolData.jar -s foo.spt

execute the script foo.spt still with rending for image creation, just
 not for screen display

 Jmoldata.jar -n -s foo.spt

   as before, now for performance enhancement, no graphics of any kind.

 Let's see how that works.

 Bob


 On Mon, Mar 19, 2012 at 8:30 PM, Robert Hanson hans...@stolaf.edu wrote:

 If awt is not there, you are out of luck. But with the -n flag there is
 no creation of Display. But there might be a reference to it. Let me see.
 Based on this discussion:
 http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
 we should be able to do it.

 Bob


 On Mon, Mar 19, 2012 at 6:06 PM, Jonathan Gutow gu...@uwosh.edu wrote:

 Bob,

 Thanks for trying...Your changes definitely reduce the error messages,
 but the application is still looking for screen dimensions somewhere in the
 tree after entering JmolPanel.  It is making a call to the awt package. I'm
 suspicious this is all associated with the allocation of a Display near
 line 242 in JmolPanel.

 I've got a solution for Sage, but we should keep picking at this as more
 people would be able to use Jmol as a server side image generator.  Some
 people really don't like running a GUI on their servers.

 Jonathan
 On Mar 19, 2012, at 3:51 PM, Robert Hanson wrote:

 Could be I'm wrong.Try what I just checked in. Be sure to use the

 -ions t.spt

 option (silent/no console/no graphics)

 You  won't get THAT error. but will it create an image? I used this
 script:

 load $tylenol
 write image 300 300 t.png


 Bob


 On Mon, Mar 19, 2012 at 7:55 AM, Gutow, Jonathan H gu...@uwosh.eduwrote:

 I dug a little and agree it would be a significant undertaking to make
 the image generation work without the GUI.  That said, we might want to put
 that on a long term to-do list.



 --
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers


   Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 UW-Oshkosh  Office: 920-424-1326
 800 Algoma BoulevardFAX:920-424-2042
 Oshkosh, WI 54901
 http://www.uwosh.edu/facstaff/gutow



 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 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




 --
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers


  Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 

Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-19 Thread Gutow, Jonathan H
I dug a little and agree it would be a significant undertaking to make the 
image generation work without the GUI.  That said, we might want to put that on 
a long term to-do list.

My solution is to run an Xsession using xpra  winswitch.  As long as I launch 
the server process in the xpra Xsession, there is always a graphics environment 
available.

Jonathan
On Mar 17, 2012, at 8:38 AM, Jonathan Gutow wrote:

 I've been working on using 12.0.45 as a server-side static graphics engine 
 for the SageMath group.  I've run into the following problem.  The server 
 does not run in an X-session, so there is no graphics environment.  This 
 causes an error when Jmol is run as Jmol.jar -ionx.  The error seems to imply 
 that we are still initializing the look-and-feel, even when there is no GUI.  
 Is there any reason we can't switch this off?  Here's the error:
 
 Exception in thread main java.lang.NoClassDefFoundError: Could not
 initialize class sun.awt.X11GraphicsEnvironment
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:186)
   at
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnviron\
 ment.java:82)
   at sun.awt.X11.XToolkit.clinit(XToolkit.java:112)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:186)
   at java.awt.Toolkit$2.run(Toolkit.java:849)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
   at
 sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:\
 121)
   at
 javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookA\
 ndFeel.java:1564)
   at
 javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.jav\
 a:147)
   at
 javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.jav\
 a:1599)
   at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
   at javax.swing.UIManager.setLookAndFeel(UIManager.java:570)
   at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1320)
   at javax.swing.UIManager.initialize(UIManager.java:1407)
   at javax.swing.UIManager.maybeInitialize(UIManager.java:1395)
   at javax.swing.UIManager.getDefaults(UIManager.java:644)
   at javax.swing.UIManager.put(UIManager.java:973)
   at org.jmol.export.dialog.Dialog.setupUIManager(Unknown Source)
   at org.openscience.jmol.app.jmolpanel.JmolPanel.startJmol(Unknown
 Source)
   at org.openscience.jmol.app.Jmol.main(Unknown Source)
 
 
 Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 UW-Oshkosh  Office: 920-424-1326
 800 Algoma BoulevardFAX:920-424-2042
 Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow
 
 
 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers

Dr. Jonathan H. Gutow
Chemistry Department gu...@uwosh.edu
UW-Oshkosh   Office:920-424-1326
800 Algoma Boulevard FAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow/


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-19 Thread Nicolas Vervelle
Hi,

You can check also tools like xvfb which can create a virtual display.

Even without the GUI, image generation may require a display for some image
operations (like fonts, ...), this is a Java limitation.
I used xvfb in several projects where I needed to create images without
having a real display.

Nico


On Mon, Mar 19, 2012 at 1:55 PM, Gutow, Jonathan H gu...@uwosh.edu wrote:

 I dug a little and agree it would be a significant undertaking to make the
 image generation work without the GUI.  That said, we might want to put
 that on a long term to-do list.

 My solution is to run an Xsession using xpra  winswitch.  As long as I
 launch the server process in the xpra Xsession, there is always a graphics
 environment available.

 Jonathan
 On Mar 17, 2012, at 8:38 AM, Jonathan Gutow wrote:

  I've been working on using 12.0.45 as a server-side static graphics
 engine for the SageMath group.  I've run into the following problem.  The
 server does not run in an X-session, so there is no graphics environment.
  This causes an error when Jmol is run as Jmol.jar -ionx.  The error seems
 to imply that we are still initializing the look-and-feel, even when there
 is no GUI.  Is there any reason we can't switch this off?  Here's the error:
 
  Exception in thread main java.lang.NoClassDefFoundError: Could not
  initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at
  java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnviron\
  ment.java:82)
at sun.awt.X11.XToolkit.clinit(XToolkit.java:112)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.Toolkit$2.run(Toolkit.java:849)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
at
  sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:\
  121)
at
  javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookA\
  ndFeel.java:1564)
at
  javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.jav\
  a:147)
at
  javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.jav\
  a:1599)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:570)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1320)
at javax.swing.UIManager.initialize(UIManager.java:1407)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1395)
at javax.swing.UIManager.getDefaults(UIManager.java:644)
at javax.swing.UIManager.put(UIManager.java:973)
at org.jmol.export.dialog.Dialog.setupUIManager(Unknown Source)
at org.openscience.jmol.app.jmolpanel.JmolPanel.startJmol(Unknown
  Source)
at org.openscience.jmol.app.Jmol.main(Unknown Source)
 
 
  Dr. Jonathan H. Gutow
  Chemistry Departmentgu...@uwosh.edu
  UW-Oshkosh  Office: 920-424-1326
  800 Algoma BoulevardFAX:920-424-2042
  Oshkosh, WI 54901
 http://www.uwosh.edu/facstaff/gutow
 
 
 
 --
  This SF email is sponsosred by:
  Try Windows Azure free for 90 days Click Here
  http://p.sf.net/sfu/sfd2d-msazure
  ___
  Jmol-developers mailing list
  Jmol-developers@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/jmol-developers

Dr. Jonathan H. Gutow
 Chemistry Department gu...@uwosh.edu
 UW-Oshkosh   Office:920-424-1326
 800 Algoma Boulevard FAX:920-424-2042
 Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow/



 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-19 Thread Gutow, Jonathan H
Nico,

I had forgot about fonts.   Since we want to be able to put text in our 
graphics, that may pretty much require us to have a GUI.  For your information, 
it appears that xpra/winswitch is an extension of the facilities provided by 
xvfb and in some cases makes use of xvfb.

Jonathan
On Mar 19, 2012, at 8:04 AM, Nicolas Vervelle wrote:

 Hi,
 
 You can check also tools like xvfb which can create a virtual display.
 
 Even without the GUI, image generation may require a display for some image 
 operations (like fonts, ...), this is a Java limitation.
 I used xvfb in several projects where I needed to create images without 
 having a real display.
 
 Nico
 
 
 On Mon, Mar 19, 2012 at 1:55 PM, Gutow, Jonathan H gu...@uwosh.edu wrote:
 I dug a little and agree it would be a significant undertaking to make the 
 image generation work without the GUI.  That said, we might want to put that 
 on a long term to-do list.
 
 My solution is to run an Xsession using xpra  winswitch.  As long as I 
 launch the server process in the xpra Xsession, there is always a graphics 
 environment available.
 
 Jonathan

Dr. Jonathan H. Gutow
Chemistry Department gu...@uwosh.edu
UW-Oshkosh   Office:920-424-1326
800 Algoma Boulevard FAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow/


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-19 Thread Robert Hanson
Could be I'm wrong.Try what I just checked in. Be sure to use the

-ions t.spt

option (silent/no console/no graphics)

You  won't get THAT error. but will it create an image? I used this script:

load $tylenol
write image 300 300 t.png


Bob


On Mon, Mar 19, 2012 at 7:55 AM, Gutow, Jonathan H gu...@uwosh.edu wrote:

 I dug a little and agree it would be a significant undertaking to make the
 image generation work without the GUI.  That said, we might want to put
 that on a long term to-do list.



-- 
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 email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-19 Thread Jonathan Gutow
Bob,

Thanks for trying...Your changes definitely reduce the error messages, but the 
application is still looking for screen dimensions somewhere in the tree after 
entering JmolPanel.  It is making a call to the awt package. I'm suspicious 
this is all associated with the allocation of a Display near line 242 in 
JmolPanel.

I've got a solution for Sage, but we should keep picking at this as more people 
would be able to use Jmol as a server side image generator.  Some people really 
don't like running a GUI on their servers.

Jonathan
On Mar 19, 2012, at 3:51 PM, Robert Hanson wrote:

 Could be I'm wrong.Try what I just checked in. Be sure to use the 
 
 -ions t.spt
 
 option (silent/no console/no graphics)
 
 You  won't get THAT error. but will it create an image? I used this script:
 
 load $tylenol
 write image 300 300 t.png
 
 
 Bob
 
 
 On Mon, Mar 19, 2012 at 7:55 AM, Gutow, Jonathan H gu...@uwosh.edu wrote:
 I dug a little and agree it would be a significant undertaking to make the 
 image generation work without the GUI.  That said, we might want to put that 
 on a long term to-do list.
 
  
 -- 
 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 email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers

 Dr. Jonathan H. Gutow
Chemistry Departmentgu...@uwosh.edu
UW-Oshkosh  Office: 920-424-1326
800 Algoma BoulevardFAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


[Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-17 Thread Jonathan Gutow
I've been working on using 12.0.45 as a server-side static graphics engine for 
the SageMath group.  I've run into the following problem.  The server does not 
run in an X-session, so there is no graphics environment.  This causes an error 
when Jmol is run as Jmol.jar -ionx.  The error seems to imply that we are still 
initializing the look-and-feel, even when there is no GUI.  Is there any reason 
we can't switch this off?  Here's the error:

Exception in thread main java.lang.NoClassDefFoundError: Could not
initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnviron\
ment.java:82)
at sun.awt.X11.XToolkit.clinit(XToolkit.java:112)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.Toolkit$2.run(Toolkit.java:849)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
at
sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:\
121)
at
javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookA\
ndFeel.java:1564)
at
javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.jav\
a:147)
at
javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.jav\
a:1599)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:570)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1320)
at javax.swing.UIManager.initialize(UIManager.java:1407)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1395)
at javax.swing.UIManager.getDefaults(UIManager.java:644)
at javax.swing.UIManager.put(UIManager.java:973)
at org.jmol.export.dialog.Dialog.setupUIManager(Unknown Source)
at org.openscience.jmol.app.jmolpanel.JmolPanel.startJmol(Unknown
Source)
at org.openscience.jmol.app.Jmol.main(Unknown Source)


 Dr. Jonathan H. Gutow
Chemistry Departmentgu...@uwosh.edu
UW-Oshkosh  Office: 920-424-1326
800 Algoma BoulevardFAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-17 Thread Jonathan Gutow
Is this because of the try{...} at line 513 of JmolPanel.java?  Shouldn't this 
be inside the preceding if..., which checks to see if the display and splash 
are enabled?

Jonathan
On Mar 17, 2012, at 8:38 AM, Jonathan Gutow wrote:

 I've been working on using 12.0.45 as a server-side static graphics engine 
 for the SageMath group.  I've run into the following problem.  The server 
 does not run in an X-session, so there is no graphics environment.  This 
 causes an error when Jmol is run as Jmol.jar -ionx.  The error seems to imply 
 that we are still initializing the look-and-feel, even when there is no GUI.  
 Is there any reason we can't switch this off?  Here's the error:
 
 Exception in thread main java.lang.NoClassDefFoundError: Could not
 initialize class sun.awt.X11GraphicsEnvironment
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:186)
   at
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnviron\
 ment.java:82)
   at sun.awt.X11.XToolkit.clinit(XToolkit.java:112)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:186)
   at java.awt.Toolkit$2.run(Toolkit.java:849)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
   at
 sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:\
 121)
   at
 javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookA\
 ndFeel.java:1564)
   at
 javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.jav\
 a:147)
   at
 javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.jav\
 a:1599)
   at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
   at javax.swing.UIManager.setLookAndFeel(UIManager.java:570)
   at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1320)
   at javax.swing.UIManager.initialize(UIManager.java:1407)
   at javax.swing.UIManager.maybeInitialize(UIManager.java:1395)
   at javax.swing.UIManager.getDefaults(UIManager.java:644)
   at javax.swing.UIManager.put(UIManager.java:973)
   at org.jmol.export.dialog.Dialog.setupUIManager(Unknown Source)
   at org.openscience.jmol.app.jmolpanel.JmolPanel.startJmol(Unknown
 Source)
   at org.openscience.jmol.app.Jmol.main(Unknown Source)
 
 
 Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 UW-Oshkosh  Office: 920-424-1326
 800 Algoma BoulevardFAX:920-424-2042
 Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow
 
 
 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Jmol-developers mailing list
 Jmol-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-developers

 Dr. Jonathan H. Gutow
Chemistry Departmentgu...@uwosh.edu
UW-Oshkosh  Office: 920-424-1326
800 Algoma BoulevardFAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Do we need to initialize the graphics environment when Jmol is running headless?

2012-03-17 Thread Robert Hanson
You can't run it without graphics if you are going to create JPG files.
. If you are doing something else, you can use JmolData.jar, which has
no graphics.



On Sat, Mar 17, 2012 at 8:38 AM, Jonathan Gutow gu...@uwosh.edu wrote:

 I've been working on using 12.0.45 as a server-side static graphics engine
 for the SageMath group.  I've run into the following problem.  The server
 does not run in an X-session, so there is no graphics environment.  This
 causes an error when Jmol is run as Jmol.jar -ionx.  The error seems to
 imply that we are still initializing the look-and-feel, even when there is
 no GUI.  Is there any reason we can't switch this off?  Here's the error:

 Exception in thread main java.lang.NoClassDefFoundError: Could not
 initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnviron\
 ment.java:82)
at sun.awt.X11.XToolkit.clinit(XToolkit.java:112)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.Toolkit$2.run(Toolkit.java:849)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
at
 sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:\
 121)
at
 javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookA\
 ndFeel.java:1564)
at
 javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.jav\
 a:147)
at
 javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.jav\
 a:1599)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:570)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1320)
at javax.swing.UIManager.initialize(UIManager.java:1407)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1395)
at javax.swing.UIManager.getDefaults(UIManager.java:644)
at javax.swing.UIManager.put(UIManager.java:973)
at org.jmol.export.dialog.Dialog.setupUIManager(Unknown Source)
at org.openscience.jmol.app.jmolpanel.JmolPanel.startJmol(Unknown
 Source)
at org.openscience.jmol.app.Jmol.main(Unknown Source)


 Dr. Jonathan H. Gutow
 Chemistry Departmentgu...@uwosh.edu
 UW-Oshkosh  Office: 920-424-1326
 800 Algoma BoulevardFAX:920-424-2042
 Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow



 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 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 email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers