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.

Soa is crashing while run the Exension File

priya107
priya107 Posts: 7

I am using a extension tool where I am running java script .This script contains winium driver and sikuli apis ,when ever I am running this script.My soa crashed and showing the Error ,as you can see in the attached screenshot .I tried every possibility like add the eclipse ini file add both -vm and mention the javaw.exe file path as research in google but still its failing .set the jdk also in env variable .This extension as I said used winium driver and sikuli to run the desktop application .In eclipse i tried the same code its working fine .but when I merge the code in Pasasoft Soa ,its crashing .Please check and update.I am using 9.10.0 .

Comments

  • priya107
    priya107 Posts: 7

    attached screenshot ,you can check my profile.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited February 2020

    The dialog says "Java was started but returned exit code=1". Did your extension invoke code that is calling java.lang.System.exit(1)?

    You could also start SOAtest (Eclipse) with the -consolelog argument, in case whatever called System.exit() printed a message to the STDOUT/STDERR stream before telling the JVM to exit.

    You could also try commenting out parts of the code in your script until you isolate the offending line that results in the JVM exiting.

  • priya107
    priya107 Posts: 7

    Hi Benken ,
    Thanks for the reply .No I am not calling java.lang.System.exit(1).Below is my code I am running in my extension file .Apart from every extension when I run is working fine .The same code I am running in eclipseIDE is working fine .I am running winium server cmd that is pointing to localhost:9999

      static WiniumDriver driver;
    public static void getLaunch() throws InterruptedException, IOException {
        DesktopOptions options = new DesktopOptions();
    
        options.setApplicationPath("C:\\Program Files\\s3browser-win32.exe");
        WiniumDriver driver = new WiniumDriver(new URL("http://localhost:9999"), 
                options);
               Pattern pattern = new Pattern("Capture.PNG");
        Screen srr = new Screen();
        setupEnvironment();
    
        Thread.sleep(20000);
    
    
    
        WebElement Upload1 = driver.findElement(By.name("Upload"));
        Thread.sleep(1000);
    
        Upload1.click();
        Thread.sleep(1000);
        WebElement Upload = driver.findElement(By.name("Upload file(s)"));
        Thread.sleep(1000);
    
        Upload.click();
        Thread.sleep(1000);
        WebElement Documents = driver.findElement(By.name("Documents"));
        Thread.sleep(3000);
    
    }
    

    You could also start SOAtest (Eclipse) with the -consolelog argument, in case whatever called System.exit() printed a message to the STDOUT/STDERR stream before telling the JVM to exit.
    For the above comment how should i do that .there is total 7 extension is there ,All should run at a time .Please update

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited February 2020

    No I am not calling java.lang.System.exit(1).

    I am not suggesting your script called this directly but that you might be calling some other API in your script that is doing this. It wouldn't necessarily be obvious, but I'm just saying the error suggests that something in the JVM may have called System.exit(1).

    For the above comment how should i do that

    I'm saying, start SOAtest with the -consolelog argument as in "soatest.exe -consolelog". If you are on Windows, this will open a separate Window that captures the STDOUT/STDERR streams. Look for any extra errors or messages there.

    You can also look for any "hs_err_pid" (java crash dump) files in the SOAtest installation directory in case some native library crashed the JVM.

    You could also try commenting out parts of the code in your script until you isolate the offending line that results in the JVM exiting.

    You need to do this part as well. You should be able to determine which line in your script is causing the JVM to exit. This way, you would be able to isolate and track down the offending piece of code without guessing. For example, did the JVM exit on the line where you instantiated DesktopOptions() or on the line where you instantiated WiniumDriver() or on a line where you called findElement() or somewhere else?

  • priya107
    priya107 Posts: 7

    I'm saying, start SOAtest with the -consolelog argument as in "soatest.exe -consolelog". If you are on Windows, this will open a separate Window that captures the STDOUT/STDERR streams. Look for any extra errors or messages there.

    Can you share some links so that I can follow and do this

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited February 2020

    Can you share some links so that I can follow and do this

    Are you using Windows? In Windows, you right click on the shortcut (the SOAtest icon in this case), click Properties, then edit the Target box where you see the path to soatest.exe. You would just add a space followed by -consolelog at the very end of the Target field. You are just passing an extra command line argument.

    Even without doing that, look if there are any "hs_err_pid" (java crash dump) files and also check which line of your script triggers the JVM exit.

  • priya107
    priya107 Posts: 7

    Target Box I can't edit and "hs_err_pid" (java crash dump) files## 1. But after removing the sikuli jar Its working fine .I am ussing winium and sikuli to run the Desktop applcaition .Now after removing the sikuli jar its woking fine .I need this jar compulsory .Is there any way i can run both jars together ,and the extension should not be crashed .I just want to run all the extension should be run at a time .

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    Target Box I can't edit

    Can't you simply do the following from the Command Prompt in Windows?
    cd "c:\Program Files\Parasoft\SOAtest\9.10"
    soatest.exe -consolelog

    and "hs_err_pid" (java crash dump) files## 1

    I'm not sure what you mean. I'm just saying to look for files beginning with this name in the SOAtest installation directory (c:\Program Files\Parasoft\SOAtest\9.10). If the JVM crashed (as opposed to existing) then this will provide detail.

    s there any way i can run both jars together ,and the extension should not be crashed

    I'm happy to make suggestions. However, you still do not know what is causing the JVM to exit. Did you isolate which line in your script causes this? This is the first step. For example, if the JVM exist when you invoke a method from the "sikuli" jar then the next step would be to look at what that method is doing, like if it is calling System.exit().

  • priya107
    priya107 Posts: 7
    edited February 2020

    Can't you simply do the following from the Command Prompt in Windows?
    cd "c:\Program Files\Parasoft\SOAtest\9.10"
    soatest.exe -consolelog

    Yes before crashing I got below Errors ,After that cmd promt closed .

    [Error]RunTimeAPI:Problematic lib:c:\Users\priya\Appdata\Roaming\Sikulix\SikulixLibs_201510051098\VisionProoxy.dll<...TEMP...>
    [Error]RunTimeAPI:VisionProxy.dll loaded,but it might be a problem with needed dependent libraries
    ERROR:Native Library...TEMP...already loaded in another class loader
    [error]RuntimeAPI:***terminating:problem with native library:visionProxy.dll

    As I said Earlier the same code working fine fine in Eclipse IDE ,In SOA its crashing .How should I found problem with needed dependent libraries as mention above

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited February 2020

    As I said Earlier the same code working fine fine in Eclipse IDE

    I'm not questioning this. :) Running a small piece of code separate process is much different than running Extension Tool which is running in same process as the entire IDE. If something calls System.exit() from an external process it wouldn't be as noticeable as if it happened in the same process as your IDE where the IDE itself would shut down.

    [error]RuntimeAPI:***terminating:problem with native library:visionProxy.dll
    

    Looks like you isolated the problem! The offending code is here:
    https://github.com/RaiMan/SikuliX1/blob/master/API/src/main/java/org/sikuli/script/support/RunTime.java

    Notice you see this class printing "problem with native library" followed by a call to its "terminate" method which then calls System.exit which results in entire JVM shutting down :(

    So, this library likes to kill the entire JVM on problems, unfortunately. There may be two separate problems.

    RunTimeAPI:VisionProxy.dll loaded,but it might be a problem with needed dependent libraries
    

    You might try searching for this error on Google or in the docs or website for this "SikuliX" library. One result I found suggested it had to do with running with 32-bit java vs 64-bit java. If the dll is 32-bit then you can't be running with a 64-bit java, like the one SOAtest might be running with, for example.

    Another error is this:

    Native Library...TEMP...already loaded in another class loader
    

    This means that something is trying to load the library twice. For example, perhaps you run one script with this "SikuliX" library and then run a second script. If the second script tries to load the dll a second time then you might run into this issue.

    This "SikuliX" library might just not be written robustly enough to use it the way you want, from a script interpreter (Extension Tool) inside of a larger application (SOAtest in this case). Instead, you may consider running your code using SOAtest External tool instead. This will launch whatever command you choose (java, groovy, python, etc.) in a separate process.
    https://docs.parasoft.com/display/SOA9108/External

  • priya107
    priya107 Posts: 7
    edited March 2020

    RunTimeAPI:VisionProxy.dll loaded,but it might be a problem with needed dependent libraries

    I got one solution below for the above Error ,Could you please tell how should I use this ,Should I download the OpenCv jar or opencv-4.2.0-vc14_vc15.exe and extract this and set in environment variable
    VisionProoxy.dll needs the OpenCV 2 libraries

    Instead, you may consider running your code using SOAtest External tool instead. This will launch whatever command you choose (java, groovy, python, etc.) in a separate process.
    https://docs.parasoft.com/display/SOA9108/External

    what is this mean .Can you please ellaborate more on this .I am not understanding the steps So.I have the extension tool where I am giving the package name ,so its calling the Java class .

    One more solution I got i.e,Using the Maven dependency for Sikuli-API works perfectly on all the platforms I've tried (Windows 7 64b, Mac OS 10.8, Ubuntu 12.4) without any hassle.
    Can you please share me the steps How can I download the Maven here coz in eclipse what is working fine ,I am using the Maven dependency and in SOA ,I am using Sikuli Jar file .Share me the steps how should run the code in maven dependency this extension tool

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited March 2020

    I have no idea what solution you found and I can't provide help with "SikuliX" library as I'm not familiar with it at all. It sounds like you think you have a missing jar, but the error suggests something wrong with a dll. So, not sure why you think a missing jar might be the issue.

    You mention "code working fine fine in Eclipse IDE". If you already have a java "main" that you can run from Eclipse then my best suggestion is for you to run that same java "main" by using SOAtest's External tool to tell java.exe to run that.

    You configure SOAtest's External tool with the path to java.exe and the arguments to java.exe. I already provided you with link to SOAtest docs for the External tool. You can find command line usage for java.exe elsewhere. Java command line looks something like: java -cp java_classpath NameOfClassWithMainMethod. So, you really need to know how java command works, and how java class path works.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited March 2020

    Since you mentioned Maven, you can also invoke Maven from an External Tool if you have a maven project that is already working and is able to run the code in question, like maybe from a unit test in the project. In your SOAtest External tool you would configure it to run something like "cmd.exe /C path_to_maven/bin/mvn.cmd -f path_to_your_maven_project/pom.xml clean test".