5 Replies Latest reply on Aug 7, 2006 10:10 AM by snyderpa

    X11 Connection and Database Manager Tool -- headless or hair

    snyderpa

      I am either going to lose my head or rip my hair out. Please suggest how to configure so that these swing components will be able to have a window. Thanks in advance. I am using :

      RHEL4
      jdk1.5.0_07
      jboss4.0.4.GA-ejb3 -c all
      connecting from WindowsXP using putty and XMing


      First try "Can't connect to X11 window server ... "

      2006-08-03 10:24:43,494 ERROR [org.jboss.jdbc.HypersonicDatabase] Failed to start database manager
      java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.jdbc.HypersonicDatabase$1.run(HypersonicDatabase.java:517)
      Caused by: java.lang.NoClassDefFoundError
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:164)
       at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
       at java.awt.Window.init(Window.java:270)
       at java.awt.Window.<init>(Window.java:318)
       at java.awt.Frame.<init>(Frame.java:419)
       at javax.swing.JFrame.<init>(JFrame.java:194)
       at org.hsqldb.util.DatabaseManagerSwing.main(Unknown Source)
       ... 5 more
      


      So, based on various posts to these forums, I tried using the "-Djava.awt.headless=true" option in my run.conf file with this result:

      2006-08-03 16:23:34,327 ERROR [org.jboss.jdbc.HypersonicDatabase] Failed to start database manager
      java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.jdbc.HypersonicDatabase$1.run(HypersonicDatabase.java:517)
      Caused by: java.awt.HeadlessException
       at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
       at java.awt.Window.<init>(Window.java:317)
       at java.awt.Frame.<init>(Frame.java:419)
       at javax.swing.JFrame.<init>(JFrame.java:194)
       at org.hsqldb.util.DatabaseManagerSwing.main(Unknown Source)
       ... 5 more



          • 1. Re: X11 Connection and Database Manager Tool -- headless or
            visolvejboss

            Hello,

            The Error is due to not setting the DISPLAY environment variable.

            Follow the steps given below.

            1. First set the DISPLAY variable as shown.

            #export DISPLAY=<ur desktop system's ip-address>:0


            2. Start your XWindow manager.

            3. Start the JBoss server and try to access hsqldb in jmx-console.




            • 2. Re: X11 Connection and Database Manager Tool -- headless or
              snyderpa

              OK, thanks for your response and I can do that, BUT I have a followup question for everyone:

              I am starting my server using an init.d script which brings the service online in runlevel 3, which seems to me like the "normal" way I would want to start and use this server. If I have to login and set an environment variable, then restart the server under the logged-in user, what good is this, really? Am I correct that the design of this database management tool makes it practically useless unless the server is always started from a login console? Or am I missing something?

              Thanks,

              Paul.

              • 3. Re: X11 Connection and Database Manager Tool -- headless or
                shadowvice

                 

                "visolvejboss" wrote:
                Hello,

                The Error is due to not setting the DISPLAY environment variable.

                Follow the steps given below.

                1. First set the DISPLAY variable as shown.
                #export DISPLAY=<ur desktop system's ip-address>:0


                2. Start your XWindow manager.

                3. Start the JBoss server and try to access hsqldb in jmx-console.




                Im sorry if I missed this... but where would I set this variable? What command would it be on Windows? Is there a file I can specify this at?

                Thanks

                • 4. Re: X11 Connection and Database Manager Tool -- headless or
                  visolvejboss

                  Hello Paul,

                  You can export DISPLAY variable in run.sh file of jboss, so that when the startup script in init.d calls the run.sh file, the DISPLAY variable will be exported.

                  "shadowvice" wrote:

                  Im sorry if I missed this... but where would I set this variable? What command would it be on Windows? Is there a file I can specify this at?


                  The steps given in the post is only for the unix/linux environment. But for windows, you don't need to specify anything, it will work with default settings itself.

                  • 5. Re: X11 Connection and Database Manager Tool -- headless or
                    snyderpa

                     

                    "visolvejboss" wrote:


                    You can export DISPLAY variable in run.sh file of jboss, so that when the startup script in init.d calls the run.sh file, the DISPLAY variable will be exported.



                    Thank you for again for responding, but it seems to me like the problem still stands:

                    When the server starts from init.d, I may be booting the server from the console attached to the machine.

                    When I want to run the Database Manager tool, I may be connecting through Putty+XMing.

                    The run.sh script only runs when the server starts and setting the DISPLAY variable there only affects the shell environment that the init.d script uses to launch the run.sh script.

                    So with the solution you suggest, would I not have to know at server startup what IP address I was going to be connecting from at a later time, code it into the run.sh script, and not be able to connect from any other IP address?