Many different X errors can produce this message. Here is the solution to one problem:
X11 Release 4 (and later, including OpenWindows) enforces some conditions in the X protocol that were previously allowed to pass unnoticed. You need to put the X11R4 server into X11R3 bug compatibility mode for Emacs's Xmenu code to work. You can do this with the command `xset bc'.