[1.1.0-Beta1] Java: Eclipse: ImagePath not set correctly at runtime

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

Bug Description

fixed in builds greater build number 2014-05-30-18
--------------------------------------------------

Hi all,

I successfully installed Sikulix IDE and run a simple script.

Then I deleted all files (except setup jar and Downloads dir) under c:\sikulix and setup again this time for Java API. This was also successful (no error in setup log and final setup message was a success). Now c:\sikulix folder contains sikulixapi.jar, lib and libs items (in addition to setup jar and downloads dir).

But when I try to run the sample Java code in Eclipse, I get the error below.

I had JDK 8 and JRE 7 at the same time on my machine. The IDE had run ok with them. When sikulix script failed, I removed JDK 8, changed my regional settings to English, but none helped.

Any help is appreciated!

Stdout:
[error] ImagePath: setBundlePath: Settings not changed: invalid BundlePath: null
[error] ResourceLoader: check: usr_paths

Stderr:
Unhandled exception
Type=Segmentation error vmState=0x00040000
J9Generic_Signal_Number=00000004 ExceptionCode=c0000005 ExceptionAddress=6567F5F1 ContextFlags=0001007f
Handler1=744E0100 Handler2=7463EF70 InaccessibleAddress=00000000
EDI=0249F9FC ESI=00000020 EAX=7453D7D8 EBX=00000000
ECX=FFFDA000 EDX=24062A18
EIP=6567F5F1 ESP=0249F8FC EBP=0249F9F4 EFLAGS=00010212
GS=002B FS=0053 ES=002B DS=002B
Module=C:\sikulix\libs\VisionProxy.dll
Module_base_address=65640000 Offset_in_DLL=0003f5f1
Target=2_60_20140313_192258 (Windows 7 6.1 build 7601 Service Pack 1)
CPU=x86 (4 logical CPUs) (0x1fce5c000 RAM)
----------- Stack Backtrace -----------
Java_org_sikuli_natives_VisionProxyJNI_Vision_1createMat+0x81 (0x6567F5F1 [VisionProxy+0x3f5f1])
VMprJavaSendNative+0x4e1 (jnisend.asm:505, 0x744F4EC1 [j9vm26+0x24ec1])
gpProtectedRunCallInMethod+0x1c (jnicsup.c:307, 0x744F055C [j9vm26+0x2055c])
signalProtectAndRunGlue+0xc (jniprotect.c:35, 0x7452646C [j9vm26+0x5646c])
j9sig_protect+0x44 (j9signal.c:150, 0x7463F154 [J9PRT26+0xf154])
gpProtectAndRun+0xc3 (jniprotect.c:72, 0x74526533 [j9vm26+0x56533])
gpCheckCallin+0x61 (jnicsup.c:525, 0x744F0811 [j9vm26+0x20811])
callStaticVoidMethod+0x43 (jnicgen.c:304, 0x744EFEF3 [j9vm26+0x1fef3])
(0x00393B7F [javaw+0x3b7f])
(0x0039B336 [javaw+0xb336])
(0x0039B3C0 [javaw+0xb3c0])
BaseThreadInitThunk+0x12 (0x74D2338A [kernel32+0x1338a])
RtlInitializeExceptionChain+0x63 (0x77109F72 [ntdll+0x39f72])
RtlInitializeExceptionChain+0x36 (0x77109F45 [ntdll+0x39f45])
---------------------------------------
JVMDUMP039I "gpf" döküm olayı (ayrıntı "") işleniyor - 2014/06/09 14:01:02 - Lütfen bekleyin.
JVMDUMP032I JVM bir olayın karşısında 'C:\Users\T14340\workspace\Proje1\core.20140609.140102.6656.0001.dmp' kullanarak System dökümü istedi
JVMDUMP010I System dökümü C:\Users\T14340\workspace\Proje1\core.20140609.140102.6656.0001.dmp içine yazıldı
JVMDUMP032I JVM bir olayın karşısında 'C:\Users\T14340\workspace\Proje1\javacore.20140609.140102.6656.0002.txt' kullanarak Java dökümü istedi
JVMDUMP010I Java dökümü C:\Users\T14340\workspace\Proje1\javacore.20140609.140102.6656.0002.txt içine yazıldı
JVMDUMP032I JVM bir olayın karşısında 'C:\Users\T14340\workspace\Proje1\Snap.20140609.140102.6656.0003.trc' kullanarak Snap dökümü istedi
JVMDUMP010I Snap dökümü C:\Users\T14340\workspace\Proje1\Snap.20140609.140102.6656.0003.trc içine yazıldı
JVMDUMP013I Döküm olayı "gpf", ayrıntı "" işlendi.

Revision history for this message
RaiMan (raimund-hocke) wrote :

Hi all,

I encounter a similar error if I use relative path in sikulix 1.1.0 beta1 (2014-05-30-18) with java client in Eclipse:
[error] ImagePath: not found on image path: ./images/arc_installer.png
[debug] ImagePath: ImagePath has 1 entries
[error] Image: Image not valid, but TextSearch is switched off!
There is no matched screen shot.

Here are my jdk environment on Windows7 32bits host:
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) Client VM (build 24.60-b09, mixed mode, sharing)

 Here are my code snipet:

public class TestSikuli {
 public static void main(String[] args) throws IOException {
  Screen s = new Screen();
  try {
   if (s.exists("./images/arc_installer.png") == null) {
    System.out.println("There is no matched screen shot.");
    return;
   }
   Pattern p = new Pattern("./images/arc_installer_close.png");
   s.click(p.targetOffset(157, -1));
   s.click("./images/arc_installer_close_ok.png");
  } catch (FindFailed e) {
   e.printStackTrace();
  }
 }
}

Then I inspected into the source using JadClipse, I found that the ImagePath.BundlePath == null, I tried to add the static initialize code beloe in my class, then the java code works well.
 static {
  System.out.println("BundlePath: " + ImagePath.getBundlePath());
  ImagePath.setBundlePath(System.getProperty("user.dir"));
  System.out.println("BundlePath: " + ImagePath.getBundlePath());
 }

Changed in sikuli:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
RaiMan (raimund-hocke)
Changed in sikuli:
importance: High → Critical
RaiMan (raimund-hocke)
description: updated
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.