This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

imageIcon exception on LINUX

 
Zhenhai Li
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
There is no compile error on this application.
When the program runs to
Image inImage = new ImageIcon(orig).getImage();
the following error happens. I am using jdk1.2.2 on LINUX6.2 platform on pentium III. The X Window is XFree86. Any hint will be appreciated.
Zhenhai Li
- Error in .DCommerce -
Reason: class java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
Java Call Stack:

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.(X11GraphicsEnvironment.java:62)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java, Compiled Code)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java, Compiled Code)
at sun.awt.motif.MToolkit.(MToolkit.java:60)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java, Compiled Code)
at java.awt.Toolkit$2.run(Toolkit.java, Compiled Code)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java, Compiled Code)
at javax.swing.ImageIcon.(ImageIcon.java, Compiled Code)
at javax.swing.ImageIcon.(ImageIcon.java, Compiled Code)
at dCommerce.business.Thumbnail.createThumbnail(Thumbnail.java:30)
at dCommerce.presentation.dStoreManager.Update.processImage(Update.java, Compiled Code)
at dCommerce.presentation.dStoreManager.Update.run(Update.java, Compiled Code)
at com.lutris.appserver.server.httpPresentation.HttpPresentationManager.runPresentationObj(HttpPresentationManager.java, Compiled Code)
at com.lutris.appserver.server.httpPresentation.HttpPresentationManager.Run(HttpPresentationManager.java, Compiled Code)
at com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.serviceDirect(HttpPresentationServlet.java, Compiled Code)
at com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.service(HttpPresentationServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.Context.handleRequest(Context.java, Compiled Code)
at org.enhydra.servlet.servletManager.ServletManager.service(ServletManager.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.doARequest(HttpHandler.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.processRequests(HttpHandler.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.run(HttpHandler.java, Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you need to set your DISPLAY parameter... I've had to do this before on my Solaris workstation at work when I've logged into someone else's machine through mine and then try to run an application...

These are the steps I use to fix this...

  • When you first login to the local machine get the host name by typing hostname at the prompt.
  • After logging into the remote machine type: setenv DISPLAY hostname:0.0 replacing hostname with the host name you got as a result of the previous command.
  • Now try running your program...


  • Some things may be somewhat different for you, such as some systems use a set command instead of setenv, and this solution may not have anything to do with your problem, but hopefully it will help...

    Another question... why is this posted in the Applets forum? Wouldn't it fit much better in the Linux forum?

    -Nate
 
Zhenhai Li
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Nate;
I resolved this problem by "export DISPLAY=127.0.0.1:0.0" at the same session I started my server.
Your reply helped me. Thanks a lot
Zhenhai
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic