Forum Discussion

rloseth's avatar
rloseth
New Contributor
8 years ago

Uploaded java jar file won't work.

Hi.

I have tried to upload a java selenium jar file to create a new monitor.

But I can't get it to work.

 

I have created a runnable jar file and tested it on a Linux server that don't have the selenium libraries installed.

And that worked.

 

The messages I get when I try to run start the monitor "on demand" are:

 

Test stopped due to error
Selenium script could not be started. Possible reasons:

  • The JAR file is not runnable (does not contain a manifest with Main-Class).
  • The JAR file does not have Selenium libraries or other required libraries embedded in it.
  • The script uses an unsupported browser. AlertSite only supports Firefox and Chrome browsers. Selenium 1.0 and Selenium Grid are not supported.

 

I manage to run the jar file on a linux box without selenium installed. That should cover the first 2 points.

And I use chromedriver, because that was recommended in the docs.

 

So now I'm stuck with my problems. I'm not a java wizard, so it is most likely something that I have missed.

Do anyone have an idea on what could be wrong?

 

--

rloseth

  • Hi.

    Thank you for all the replies.

    I found my solution.

    When creating the monitor I chose only one location (Copenhagen - Denmark). And when I tried to do a on demand run to get the monitor enabled, it always failed.

    After a hole lot of clicking around I changed my location to Amsterdam, and that worked. I even tried to use my first jar upload and that worked too.

    So the problem is solved.

    There may be some strange things in the location system in AlertSite, but my problem is solved for now.

     

    Once again, thanx for all the suggestions. :)

     

    --

    rloseth

  • rloseth's avatar
    rloseth
    New Contributor

    Hi.

    Thank you for all the replies.

    I found my solution.

    When creating the monitor I chose only one location (Copenhagen - Denmark). And when I tried to do a on demand run to get the monitor enabled, it always failed.

    After a hole lot of clicking around I changed my location to Amsterdam, and that worked. I even tried to use my first jar upload and that worked too.

    So the problem is solved.

    There may be some strange things in the location system in AlertSite, but my problem is solved for now.

     

    Once again, thanx for all the suggestions. :)

     

    --

    rloseth

    • SJeffries's avatar
      SJeffries
      Staff

      There does indeed seem to be an issue in Copenhagen which is being worked on now. Will post again when it's fixed.

    • rloseth's avatar
      rloseth
      New Contributor

      Hi.

      I have gone through the info and prepared the jar according to the documentation.

      I have used the example in the documentation for the main() method and exported as runnable jar.

      The jar runs like it should on a local Ubuntu box.

       

      Still no luck on AlertSite.

       

      --

      rloseth

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi rloseth,

     

    How do you set the Chrome driver path? Do you use the PATH environment variable or set the system property "webdriver.chrome.driver" from your code? If the latter, try wrapping the assignment as follows:

    if (System.getProperty("webdriver.chrome.driver") == null) {
      System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
    }