Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Why am I getting java.awt.HeadlessException while launching loadtest commandline?

brawal
brawal Posts: 26
  • Loadtest has been installed in Linux machine
  • Create a loadtest script (ex. loadtestscript) to run the command line
  • using the following command to run the loadtest commandline
  • ./loadtest -cmd -run loadtestscript
  • Got an Error : java .awt.headlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207

Answers

  • Sergei
    Sergei Posts: 34

    Could you paste the entire console log with the exception stack trace and the Load Test version? I just checked a recent Load Test release on a machine that returns 'true' for the GraphicsEnvironment.isHeadless() Java call and runs without problems:

    [user@host 9.10.4]$ ./loadtest -cmd -run ../projects/run.cmd
    Parasoft Load Test 9.10.4.20180202
    ---------- Load Test ----------
    LoadTester stopped. [ Total Run Count = 1878; Failure Count = 0 ]

    Also what Linux are you running on?
    You could run either cat /etc/os-release or cat /etc/issue to get release info.

  • brawal
    brawal Posts: 26

    Release : Red Hat Enterprise Linux Server release 6.9 (Santiago)
    ./loadtest -password XXXXXXXXX -cmd -run loadtestcmd
    The following is the detail errors log after issuing the command:

    java.awt.HeadlessException
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
    at java.awt.Window.(Window.java:535)
    at java.awt.Frame.(Frame.java:420)
    at javax.swing.JFrame.(JFrame.java:224)
    at com.parasoft.gui.Console.(Console.java:41)
    at webtool.gui.WebtoolConsole.(WebtoolConsole.java:70)
    at webtool.app.WebtoolApp.createConsole(WebtoolApp.java:1096)
    at webtool.app.WebtoolApp.(WebtoolApp.java:685)
    at webtool.app.WebtoolApp.(WebtoolApp.java:561)
    at webtool.app.WebtoolApp.(WebtoolApp.java:556)
    at webtool.app.WebtoolApp.(WebtoolApp.java:553)
    at webtool.app.WebtoolApp.(WebtoolApp.java:550)
    at webtool.app.WebtoolApp.main(WebtoolApp.java:2570)

    command line script :smile:
    loadtestcmd file contents:
    #

    Using script commands

    #
    var report-name = /mefperf/TestData/parasoft/LoadTestReports/
    var minutes = 10
    var scenario = "Steady Load"
    var base = /root/parasoft/workspace9.9/LoadTestProjects
    var category = Accuracy
    var test-name = MQ-Batch1
    open ${base}/${test-name}.lt
    ./loadtest -minutes ${minutes} -allReports ${report-home}/%d/${category}/${test-name} ${scenario}
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    "loadtestcmd" 11L, 369C

  • brawal
    brawal Posts: 26

    Loadtest version : 9.9 (build date june02, 2016) service pack version :5

  • Sergei
    Sergei Posts: 34

    Please contact Parasoft tech support about this issue. I let them know about your case, and they will set you up with an alternative licensing that will allow you to run Load Test on headless machines. When contacting Parasoft support please refer to this forum page.