Can't connect to X11 window server using DISPLAY variable

kidking2010發表於2011-04-28

今天一個同事問我在的時候出現了
Exception in thread "main" .lang.InternalError: Can't connect to X11 window
using ':0.0' as the value of the DISPLAY variable.

這個錯誤是為什麼,其實我知道是由於當前使用者不是或者環境變數設定的不正確導致的,因為每次都是用oracle使用者解壓,安裝,沒有遇到這個問題,所以也沒有仔細研究過這個錯誤,今天正好同事問到我這個問題,如果不回答清楚了顯的我很不專業,呵呵,在這裡簡單說明一下自己的理解:

cause:
X-Windows emulation is not yet correctly configured or is being mis-used.
solution:
1.Make sure that "DISPLAY” is set properly as either:
     :0.0
          or
     :0.0
note:In this example, ip_address/hostnameis the host name or IP address of the system that you want to use to display Oracle Universal Installer (your workstation or PC).
eg.[root@rac1 ~]# xhost +
access control disabled, clients can connect from any host
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ export DISPLAY=192.16.2.98:0.0
[oracle@rac1 ~]$ cd database/
[oracle@rac1 database]$ ./runInstaller
Starting Oracle Universal Installer... 
Checking installer requirements... 
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed 
All installer requirements met. 
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-03-05_03-36-28PM. Please wait ...[oracle@rac1 database]$ Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, , Oracle. All rights reserved.

2. Oracle Customer Support has seen instances where use of the UNIX/Linux “su” command, even “su - oracle” has caused this “Can't connect to X11 window server” error. Therefore, please be sure that you are LOGGED ON as the oracle account. Log directly into the install session. Do not use any variety of “su”.
     use oracle log on , not "su - oracle"
eg. [oracle@rac1 database]$ ./runInstaller

3.Oracle Customer Support has seen instances where the incorrect “ulimit” setting for number of files (aka “-n”, aka “nofiles”) has caused this “Can't connect to X11 window server” error. Therefore, please be sure that your values for “nofiles” in the output of “ulimit -a” is at least 65536.

備註:前2個辦法只需要滿足其中一個就可以避免這個錯誤了:直接用oracle登陸,不能su - oracle  or 設定display=ip_address_that you want to use to display Oracle Universal Installer:0.0


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23141985/viewspace-694039/,如需轉載,請註明出處,否則將追究法律責任。

相關文章