participate


Swing [Archive] - X11 Window problem for Swing in Linux ! Urgent!Urgent!!!
<<   Back to Forum  |   Give us Feedback
This topic has 7 replies on 1 page.
joearul
Posts:53
Registered: 8/28/00
X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Mar 13, 2002 9:56 PM

 
Hai!

I have developed one application in Java Swing.Its running well in all Windows Operating System. When I run in Linux, if I run from XTerm its running well but, when run from other terminals it gives the following error.

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:58)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:59)
at sun.awt.motif.MToolkit.(MToolkit.java:56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.Toolkit$2.run(Toolkit.java:495)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:488)
at javax.swing.ImageIcon.(ImageIcon.java:60)
at javax.swing.ImageIcon.(ImageIcon.java:79)
at erp.eshopping.util.imageinfo.setSource(imageinfo.java:35)
at erp.eshopping.news_clipping.news_clipping_Servlet.doPost(news_clipping_Servlet.java:282)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:267)
at allaire.jrun.WorkerThread.run(WorkerThread.java:74)



I tried to export DISPLAY=a3:0.0
a3 is my system name
But Again I got following error

xlib: connection to "a3:0.0" refused by server
xlin: client is not authorized to connect to server


What I have to do?

Please anyone help to me!
 
alsues
Posts:54
Registered: 4/6/00
Re: X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Mar 14, 2002 9:49 AM (reply 1 of 7)  (In reply to original post )

 

If the "eshoppin"... classes are your classes, it looks like it might be having a problem retreiving an image?
 
martinm1000
Posts:187
Registered: 12/11/00
Re: X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Mar 14, 2002 11:59 AM (reply 2 of 7)  (In reply to original post )

 
Hi,

Do you have the DISPLAY environment variable defined in the shell you try to run java ?

can you do a echo $DISPLAY ? What does it returns ?
 
joearul
Posts:53
Registered: 8/28/00
Re: X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Mar 17, 2002 7:28 PM (reply 3 of 7)  (In reply to #2 )

 
I set the Display environment variable like follow

export DISPLAY=a3:0.0
a3 is my system name
But I got following error

xlib: connection to "a3:0.0" refused by server
xlin: client is not authorized to connect to server


What I have to do now?

Thanks in advance
Joseph
 
joearul
Posts:53
Registered: 8/28/00
X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Mar 21, 2002 7:39 PM (reply 4 of 7)  (In reply to #3 )

 
I set the Display environment variable like follow

export DISPLAY=a3:0.0
a3 is my system name
But I got following error

xlib: connection to "a3:0.0" refused by server
xlin: client is not authorized to connect to server


What I have to do now?

Thanks in advance
Joseph
 
marc_huhardeaux
Posts:258
Registered: 3/22/01
Re: X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Mar 21, 2002 11:55 PM (reply 5 of 7)  (In reply to #4 )

 
authorise your host to connect to the one your running from with "xhost a3". This way, the connection should be enabled, but not the display. You need to import it with the display command.

The xhost command must be run from the reciever system, not the distant one.
 
blaisec
Posts:1
Registered: 7/14/02
Re: X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Jul 14, 2002 2:02 PM (reply 6 of 7)  (In reply to original post )

 
You need to install and configure Xvfb for image processing. It is fantastic because you do not need to know any hardware settings. Here's the link that saved my day: http://www.psoft.net/ssdoc/install-linux.html#1. Follow instructions carefully. If you have any problems with installation, email me at che_blaise@yahoo.com
 
Mahanare
Posts:28
Registered: 9/22/03
Re: X11 Window problem for Swing in Linux ! Urgent!Urgent!!!   
Jul 29, 2004 3:06 AM (reply 7 of 7)  (In reply to #6 )

 
I am facing the problem now in 2004.

any help on this?
please.

thing is in redhat 9 it is working fine.
in RHAS 3.0 or RHES 3.0 etc i am facing problem.


<Jul 29, 2004 12:38:50 PM IST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=27655524,name=createaccount,context-path=/createaccount)]
java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
at com.aga.securus.createaccount.TextProducer.createImage(TextProducer.java:54)
at com.aga.securus.createaccount.ImageGenerationAction.execute(ImageGenerationAction.java:55)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
<Jul 29, 2004 12:38:50 PM IST> <Error> <HTTP> <BEA-101107> <[ServletContext(id=27655524,name=createaccount,context-path=/createaccount)] Problem occurred while serving the error page.
javax.servlet.ServletException: Missing message for key "ImageGenerationAction.do"
at weblogic.servlet.jsp.PageContextImpl.handlePageException(PageContextImpl.java:318)
at jsp_servlet._resources._jsp.__header._jspService(header.jsp:67)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:594)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:409)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:155)
at jsp_servlet._resources._jsp.__error._jspService(error.jsp:17)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.RequestDispatcherImpl$ForwardAction.run(RequestDispatcherImpl.java:382)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:286)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:523)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:375)
at weblogic.servlet.internal.WebAppServletContext.handleException(WebAppServletContext.java:3897)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3672)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
 
This topic has 7 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 26
  • Guests : 129

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums