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

Asked by Çağın Uludamar

fixed - see related bug
---------------------------------

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.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

You are using the 1.1.0-Beta1 in a version, that does not allow to run in Java 32-Bit mode.

Either use a Java in 64-Bit mode or download and setup again with the latest version (start with an empty setup folder).

Revision history for this message
Çağın Uludamar (culudamar) said :
#2

Thanks for your response.

I think I was using the latest version, setup jar is sikulixsetup-1.1.jar. But still I deleted everything in C:\Sikulix and re-downloaded it. Setup still gets:

[error (11.06.2014 11:25:50)] FileManager: Download: getFileSize: not accessible:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error (11.06.2014 11:25:53)] RunSetup: Fatal error 001: not able to download: 1.1.0-Beta1-2.jar

I downloaded 1.1.0-Beta1-2.jar manually and rerun setup. Setup completes successfully, but problem remains.

java -version prints:
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)

It says mixed mode, but as far as I see in the Java config, this is about security. So I guess it is 32 bit java.
Upgrading to 64 bit Java would be the last choice because of other software dependencies.

Is it possible that latest version of sikulix does not work with 32 bit java?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

yes, you are running a 32-Bit Java (Java HotSpot(TM) Client VM ).
64-Bit should say: Java HotSpot(TM) 64-Bit Server VM

If you downloaded all stuff again after May 30th, then it should work with Java 32-Bit (the version before did not).

--- About your security validation problem:
Your local Java does not find a valid certificate for the target url (which is on Launchpad and should be valid).
So it might be a problem with your Java installation and/or your local security policies.
This is the first time I heard about that, many other people do not have that problem apparently.
For me e.g. it runs fine with Java 6 to 8.

Revision history for this message
Çağın Uludamar (culudamar) said :
#4

I downloaded all the stuff today :(

Revision history for this message
Best RaiMan (raimund-hocke) said :
#5

have you tried version 1.0.1 (now need to use the Beta now)?

Revision history for this message
Shengyuan Gu (gushengyuan2002) said :
#6

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());
 }

Revision history for this message
RaiMan (raimund-hocke) said :
#7

made it a bug

Revision history for this message
RaiMan (raimund-hocke) said :
#8

@ Shengyuan Gu
Thanks for pointing out.
fixed in build towards end of this week.

Revision history for this message
Çağın Uludamar (culudamar) said :
#9

Downgraded to 1.0.1 and now it works fine!

Revision history for this message
Çağın Uludamar (culudamar) said :
#10

Thanks RaiMan, that solved my question.