[request] sikuli-java.jar should better support having it in additional places besides the setup folder --- fixed in 1.1.0: can be wherever you want

Bug #1227541 reported by RaiMan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

Bug Description

Hello,

I am getting following error when running from batch file

==Recieved next Command 'openApp' with Target 'notepad.exe' and Value ''
Executing method 'openApp' with target 'notepad.exe' and value ''
openApp method called with target 'notepad.exe'
[error] ResourceLoaderBasic: loadLib: Fatal Error 110: loading: WinUtil.dll
[error] ResourceLoaderBasic: loadLib: Since native library was found, it might be a problem with needed dependent libraries
F:\workspace\Sikuli\lib\libs\WinUtil.dll: Can't find dependent libraries
[error] ResourceLoaderBasic: loadLib: Check, wether a valid Sikuli libs folder is in system path at runtime!
[error] Terminating SikuliX after a fatal error(110)! Sorry, but it makes no sense to continue!
If you do not have any idea about the error cause or solution, run again
with a Debug level of 3. You might paste the output to the Q&A board.
Press any key to continue . . .

This is how my batch file looks like :
@echo off
set CLASSPATH=
java -cp "lib/*" com.ists.sikuli.TestExecutor FileActions.xls FileFunctions TC20001
pause

com.ists.sikuli.TestExecutor is main class that takes three params i.e. file, sheet, and testcase name

here is how my main method looks like

public static void main(String[] args) throws Exception {
  if(args.length<2){
   throw new RuntimeException("Arguments less than 3 - Can not continue with execution");
  }
  String file = args[0];
  String sheet = args[1];
  String testCaseName = args[2];
  System.out.printf("Executing testcase %s defined in sheet %s and in file %s\n", args[2], args[1], args[0]);
  TestExecutor test = new TestExecutor();
  test.executeTestCase(file, sheet, testCaseName);
 }

When i run same thing from eclipse everything works perfectly.

I have following under lib
- my compiled jar
- sikuli-java.jar
- other jars not related to sikuli
- and sikuli libs folder

I can see "WinUtil.dll" file present under lib/libs/ folder

Please help me in resolving this issue.

Thanks
Gulshan

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [request] sikuli-java.jar should better support having it in additional places besides the setup folder

problem here is the libs path not in system path at runtime.

a batch fixing this problem:
@echo off
setlocal
set CLASSPATH=
set PATH=%~dp0\lib\libs;%PATH%
java -cp "lib/*" com.ists.sikuli.TestExecutor FileActions.xls FileFunctions TC20001
endlocal

BTW: You only need to copy the sikuli-java.jar around. With the above batch, Sikuli internally will finally decide to create a libs folder exactly in this place and copy the correct libs to this folder at runtime.

summary: - [request] sikuli-java.jar should support having it in additional places
- than the setup folder
+ [request] sikuli-java.jar should better support having it in additional
+ places besides the setup folder
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
RaiMan (raimund-hocke)
Changed in sikuli:
status: In Progress → Fix Committed
importance: Medium → High
RaiMan (raimund-hocke)
Changed in sikuli:
importance: High → Critical
summary: [request] sikuli-java.jar should better support having it in additional
- places besides the setup folder
+ places besides the setup folder --- fixed in 1.1.0: can be wherever you
+ want
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.