← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #281182]: Null pointer exception using Sikuli in Java

 

Question #281182 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/281182

    Status: Open => Answered

RaiMan proposed the following answer:
I have no idea, why this happens in your special setup.

the code in org.sikuli.script.RunTime

    CodeSource codeSrc = clsRef.getProtectionDomain().getCodeSource();
    String base = null;
    if (codeSrc != null && codeSrc.getLocation() != null) {
      base = FileManager.slashify(codeSrc.getLocation().getPath(), false);
    }
    appType = "from a jar";
    if (base != null) {
      fSxBaseJar = new File(base);
      String jn = fSxBaseJar.getName();
      fSxBase = fSxBaseJar.getParentFile();
      log(lvl, "runs as %s in: %s", jn, fSxBase.getAbsolutePath());
      if (jn.contains("classes")) {

where the last line is the crash point (line 635)

it only gets there, if base is != null and I have no idea, why jn can be
null at this place.

The only idea:
base at this point might be be an empty string, but File.getName() according to the API, does not return null.

Did you have the log message, that is produced before the crashing line:
.... runs as .... in: ....

if not, then try to add 
-Dsikuli.Debug=3
to the Java environment

I am sorry, but I have no means, to test the behavior in such
environment, that you are using.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.