Forum Discussion

MuleHeadJoe's avatar
14 years ago

Can SoapUI be installed on a headless linux server?

Host server: Ubuntu 11.04
Client (remote): Ubuntu 11.10

So, two main questions:

1) can SoapUI be installed at all on a 'headless' linux server? (i.e., used via a command line interface?)

2) if a display is required, does anyone know how to set up & export a display from the headless server to a remote box?

Here's the background:

Trying to install SoapUI on a headless server hosted in 'the cloud' ... I've installed java and x11 but can't seem to get the xserver to run, and the soapui setup script ($SOAPUI_HOME/bin/soapui.sh) fails (exits with errors).

I was hoping I could install X11 and export the display to my remote box ... I installed 'xorg' which seemed to run fine, then I set display with "export DISPLAY=[ip addy]:0.0" but I'm not getting any joy ...

error message from soapui.sh:

Failed to create icon: java.lang.InternalError: Can't connect to X11 window server using '0.0' as the value of the DISPLAY variable.
Configuring log4j from [/home/ubuntu/soapui-4.0.1/bin/soapui-log4j.xml]
22:48:14,424 INFO [DefaultSoapUICore] initialized soapui-settings from [/home/ubuntu/soapui-4.0.1/soapui-settings.xml]
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at java.awt.Window.init(Window.java:380)
at java.awt.Window.<init>(Window.java:433)
at java.awt.Frame.<init>(Frame.java:403)
at javax.swing.JFrame.<init>(JFrame.java:202)
at com.eviware.soapui.SoapUI.startSoapUI(SoapUI.java:748)
at com.eviware.soapui.SoapUI$SoapUIRunner.run(SoapUI.java:634)
at com.eviware.soapui.SoapUI.main(SoapUI.java:733)

--------
any advice would be welcome ...

2 Replies

  • Yes. I have it installed on a headless Ubuntu virtual host. Here is a rough, by-memory list of general steps needed to get it running... And I will start with a bit of a X11 discussion so clear up some common confusion:

    In X11, the 'X11 server' is the device that possesses the display screen that you will be looking at. The 'client' is the host where the X11 application is running. So for your purposes, you need to install "X11 Server" on your local windows machine, and "X11 Client" stuff on your Ubuntu host. The X11 client software will be Java and SoapUI running on the ubuntu machine, which is the X11 client that will connect to the X11 Server in your laptop to access your laptop's display, where the SoapUI user interface will appear. You need a connection between your Ubuntu machine and your windows machine to transfer the X11 graphics from the client (the ubuntu host) to the X11 server (the windows display.) It is very common to use ssh tunnelling to handle this, as the typical network security design in common use these days blocks X11 traffic, especially if you are using a VPN as I am.

    X11 dates from the days when all Unix systems were multi-user mini-computers locked in server rooms and were, by definition, headless. So the concept of a 'display server' is strange to you young'uns.


    1) install cygwin and cygwin-X11 on my windows 7 laptop. Include openssh packages.
    2) install 64-bit JRE and X11 client libraries on the ubuntu machine. ('sudo apt-get install rxvt' will install an X11 client application which will automatically load a bunch of X11-related client libraries and dependencies. 'sudo apt-get install IcedTea7' should get you a suitable JRE. I already had one installed for other apps so didn't have to install a JRE specific to SoapUI.)
    3) install openssh on your ubuntu machine. Install xauth on ubuntu if it isn't already there, 'sudo apt-get install xauth' because Ssh needs this to setup X11 packet forwarding through the ssh tunneling.
    4) configure ssh on your laptop and your ubuntu so that you can ssh from cygwin into the ubuntu and receive a command prompt. IE 'ssh ubuntuhost' should leave you looking at a bash prompt on the ubuntu host. Ie open a cygwin shell window on your laptop, and ssh into your ubuntu host.
    5) Verify your /etc/ssh/sshd.conf file is setup to allow X11 forwarding.
    5) Now you should be able to open an X11 forwarding connection into your server.
    Launch your app thusly:

    Cygwin$ ssh -Y userame@ubuntu /path/to/your/soapui.sh

    After a moment or three you should see a soapui window pop up on your laptop. If you need a simpler test of X11 you can try:

    Cygwin$ ssh -Y username@ubuntu /usr/bin/rxvt

    Which should leave you looking at a rxvt terminal window with a bash prompt from your ubuntu host, on your windows laptop.

    I'm using this over a remote VPN, it's a bit slower than running the app naively on windows, but it does work.
  • Since both of your machines are Ubuntu, no need to install any of that Windows-specific Cygwin stuff on the client.

    If the server is 12.04 Precise Pangolin or earlier:
    sudo add-apt-repository ppa:upubuntu-com/web && sudo apt-get update && sudo apt-get install soapui && sync

    Then make sure minimal xserver for a headless machine is installed:
    sudo apt-get install xvfb

    Make sure that X forwarding is enabled in your /etc/ssh/sshd_config file ... these values in there must be uncommented if they are not already:
    X11Forwarding yes
    X11DisplayOffset 10
    PrintMotd no
    PrintLastLog yes
    TCPKeepAlive yes
    Edit as needed with admin rights using a text editor like vim or nano, save changes.

    Restart sshd:
    sudo service ssh restart

    On the Ubuntu client side:
    ssh -XC <hostname>

    And then:
    /usr/bin/soapui-4.5.0/bin/soapui.sh

    And after a while, depending on the speed of your connections, you should see it appear.

    If your server is now later than 12.04 Precise, download the Precise deb file for your architecture, either soapui_4.5.0~precise_amd64.deb (64bit) or soapui_4.5.0~precise_i386.deb (32bit) from:
    http://ppa.launchpad.net/upubuntu-com/w ... /s/soapui/
    And then:
    sudo dpkg -i <filename-of-package-you-downloaded>
    The 12.04 Precise 32bit deb is so far confirmed working on 12.10 Quantal, 13.04 Raring, and 13.10 Saucy 32 bit systems.

    NOTE:I have not tested the 64bit versions on later than 12.04, only the 32 bit versions. I have not yet tried to upgrade from the default 4.5.0 the package provides. I speculate this will probably change the path of /usr/bin/soapui-4.5.0/bin/soapui.sh to reflect whichever version you upgrade to.