If you attempt to run a Hamsam program on a console,
without an X server present, you get the following
exception...
Exception in thread "main" java.lang.InternalError:
Can't connect to X11 window server using ':0.0' as the
value of the DISPLAY variable.
at
sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:125)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
at
sun.awt.motif.MToolkit.<clinit>(MToolkit.java:72)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at java.awt.Toolkit$2.run(Toolkit.java:712)
at
java.security.AccessController.doPrivileged(Native Method)
at
java.awt.Toolkit.getDefaultToolkit(Toolkit.java:703)
at javax.swing.ImageIcon.<init>(ImageIcon.java:119)
at javax.swing.ImageIcon.<init>(ImageIcon.java:138)
at
hamsam.protocol.yahoo.Util.loadSmileys(Util.java:192)
at
hamsam.protocol.yahoo.YahooProtocol.<init>(YahooProtocol.java:143)
at
hamsam.protocol.ProtocolManager.<clinit>(ProtocolManager.java:60)
As can be seen it seems to want to create some image
icons of some sort, even though they are not yet called
for.
Suggest not attempting to call AWT to get images until
something the application does demands them, otherwise
daemon and console programs using hamsam are not easy
to do.
Logged In: YES
user_id=624085
Have you tried this?
http://forum.java.sun.com/thread.jsp?
forum=31&thread=51029
I mean "-Djava.awt.headless=true", if u use the JDK 1.4
I am planning to start using the hamsam lib as a console
application as well. Let me know if it helps, read the whole
article.
Yet you have a point in changing the API not to use the AWT
until an image is required or the performance impact is still
payed (for accessing AWT lib via this loopback).
Logged In: YES
user_id=785028
Yes, setting this system property seems to stop the
exception. No idea if smileys are still working as I am not
using them in this app.