← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #667565]: Mac: NullPointerException when running via ssh

 

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

Ilya Anshmidt posted a new comment:
Regarding your second comment:

Thank you, I've tried running with debug option, and looks like the
issue is caused by Jython getting screen size incorrectly when running
script via ssh.


Output when I run the script directly on the machine:

[error] RunTimeINIT: *** BE AWARE: Running on Java 8+ *** Please report problems ***
[debug] RunTimeINIT: loadOptions: check: /Users/shareduser/Downloads/RF_Mac_automation/scripts
[debug] RunTimeINIT: loadOptions: check: /Users/shareduser
[debug] RunTimeINIT: loadOptions: check: /Users/shareduser/Library/Application Support/Sikulix/SikulixStore
[debug] RunTimeINIT: global init: entering as: IDE
[debug] RunTimeINIT: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment()
[debug] RunTimeINIT: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()
[debug] RunTimeINIT: ScreenDevice 0 has (0,0) --- will be primary Screen(0)
[debug] RunTimeINIT: Monitor 0: (0, 0) 1680 x 1050
[debug] RunTimeINIT: runs as sikulix.jar in: /Applications/SikuliX.app/Contents/Java
[debug] RunTimeINIT: exists libs folder at: /Users/shareduser/Library/Application Support/Sikulix/SikulixLibs_201804041055
***** show environment for IDE (build 201804041055)
user.home: /Users/shareduser
user.dir (work dir): /Users/shareduser/Downloads/RF_Mac_automation/scripts
user.name: shareduser
java.io.tmpdir: /var/folders/05/953xk3vn0k7_ds769f4fst800000gp/T
running 64Bit on Mac OSX (10.12.6) as application .app
java 9-64 version 9.0.4 vm 9.0.4+11 class 53.0 arch x86_64
app data folder: /Users/shareduser/Library/Application Support/Sikulix
libs folder: /Users/shareduser/Library/Application Support/Sikulix/SikulixLibs_201804041055
executing jar: /Applications/SikuliX.app/Contents/Java/sikulix.jar
[error] RunTimeIDE: *** Java 8+: skipped: dumpClassPath()
***** show environment end
[debug] RunTimeIDE: global init: leaving
[debug] RunTimeIDE: initIDEbefore: entering
[debug] RunTimeIDE: initIDEbefore: leaving
[debug] RunTimeIDE: initAPI: entering
[debug] RunTimeIDE: resourceList: enter
[debug] RunTimeIDE: resourceLocation: (class org.sikuli.ide.SikuliIDE) /Lib/sikuli
[debug] RunTimeIDE: resourceList: having jar: jar:file:/Applications/SikuliX.app/Contents/Java/sikulix.jar!/Lib/sikuli
[debug] RunTimeIDE: files exported: 7 from: Lib/sikuli to:
 /Users/shareduser/Library/Application Support/Sikulix/Lib/sikuli
[debug] RunTimeIDE: initAPI: leaving
[debug] IDE: Switching to ScriptRunner with option -r, -t or -i
[debug] Runner: commandline: 
[debug] --- Sikuli parameters ---
[debug] 1: -r
[debug] 2: /Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli
[debug] ScriptingSupport: givenScriptName:
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli
[debug] ScriptingSupport: Trying to run script:
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli/click_safenotes.py
[debug] ScriptingSupport: initScriptingSupport: enter
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.python.core.PySystemState (file:/Applications/SikuliX.app/Contents/Java/sikulix.jar) to method java.io.Console.encoding()
WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[debug] JythonSupport: init: starting
[debug] JythonSupport: init: success
[debug] JythonSupport: added as Jython::sys.path[0]:
/Users/shareduser/Library/Application Support/Sikulix/Lib/site-packages
[debug] JythonSupport: ***** Jython sys.path
 0: /Users/shareduser/Library/Application Support/Sikulix/Lib/site-packages
 1: /Users/shareduser/Library/Application Support/Sikulix/Lib
 2: /Applications/SikuliX.app/Contents/Java/Lib
 3: /Applications/SikuliX.app/Contents/Java/sikulix.jar/Lib
 4: __classpath__
 5: __pyclasspath__/
[debug] JythonSupport: ***** Jython sys.path end
[debug] Jython: sikuli: Sikuli: starting init
[debug] RunTimeIDE: loadLib: libVisionProxy.dylib
[debug] Mouse: init start
[debug] Mouse: init end
[debug] RunTimeIDE: loadLib: libMacUtil.dylib
[debug] Jython: requested to use as default region: S(0)[0,0 1680x1050]
[debug] Jython: sikuli: Sikuli: ending init
[debug] JythonScriptRunner: running Jython 2.7.1 
[debug] ScriptingSupport: initScriptingSupport: added: jython
[debug] ScriptingSupport: initScriptingSupport: added: JavaScript
[debug] ScriptingSupport: initScriptingSupport: exit with defaultrunner: jython (py)
[debug] ImagePath: new BundlePath:
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli/
[debug] Jython: requested to use as default region: S(0)[0,0 1680x1050]
[debug] JythonScriptRunner: runPython: running script: 
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli
[debug] Image: loaded: 1522143552641.png (file:/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli/1522143552641.png)
[debug] Image: cached: 1522143552641.png (6 KB) (# 1 KB 6 -- 0 % of 64 MB)
[debug] Region: wait: waiting 3.0 secs for 1522143552641.png to appear in S(0)[0,0 1680x1050]
[debug] Region: wait: 1522143552641.png appeared (M[45,316 108x20]@S(S(0)[0,0 1680x1050]) S:1.00 C:99,326 [992 msec])
[debug] Region: init: (0, 0, 5, 5)
[debug] CLICK on L(99,326)@S(0)[0,0 1680x1050] (1024 msec)
[debug] RunTimeIDE: final cleanup
[debug] FileManager: deleteFileOrFolder:
/var/folders/05/953xk3vn0k7_ds769f4fst800000gp/T/Sikulix_507924032


Output of the same script on the same machine, when I access and run it
via ssh from another machine:

[debug] RunTimeINIT: loadOptions: check: /Users/shareduser
[debug] RunTimeINIT: loadOptions: check: /Users/shareduser
[debug] RunTimeINIT: loadOptions: check: /Users/shareduser/Library/Application Support/Sikulix/SikulixStore
[debug] RunTimeINIT: global init: entering as: IDE
[debug] RunTimeINIT: running in headless environment
[debug] RunTimeINIT: runs as sikulix.jar in: /Applications/SikuliX.app/Contents/Java
[debug] RunTimeINIT: exists libs folder at: /Users/shareduser/Library/Application Support/Sikulix/SikulixLibs_201803080837
***** show environment for IDE (build 201803080837)
user.home: /Users/shareduser
user.dir (work dir): /Users/shareduser
user.name: shareduser
java.io.tmpdir: /var/folders/31/srmmps8x0td7l97qp41d5_dw0000gp/T
running 64Bit on Mac OSX (10.10.5) as application .app
java 8-64 version 1.8.0_101-b13 vm 25.101-b13 class 52.0 arch x86_64
app data folder: /Users/shareduser/Library/Application Support/Sikulix
libs folder: /Users/shareduser/Library/Application Support/Sikulix/SikulixLibs_201803080837
executing jar: /Applications/SikuliX.app/Contents/Java/sikulix.jar
*** classpath dump sikulix
  0: /Applications/SikuliX.app/Contents/Java/sikulix.jar
*** classpath dump end
***** show environment end
[debug] RunTimeIDE: global init: leaving
[debug] RunTimeIDE: initIDEbefore: entering
[debug] RunTimeIDE: initIDEbefore: leaving
[debug] RunTimeIDE: initAPI: entering
[debug] RunTimeIDE: resourceList: enter
[debug] RunTimeIDE: resourceLocation: (class org.sikuli.ide.SikuliIDE) /Lib/sikuli
[debug] RunTimeIDE: resourceList: having jar: jar:file:/Applications/SikuliX.app/Contents/Java/sikulix.jar!/Lib/sikuli
[debug] RunTimeIDE: files exported: 7 from: Lib/sikuli to:
 /Users/shareduser/Library/Application Support/Sikulix/Lib/sikuli
[debug] RunTimeIDE: initAPI: leaving
[debug] IDE: Switching to ScriptRunner with option -r, -t or -i
[debug] Runner: commandline: 
[debug] --- Sikuli parameters ---
[debug] 1: -r
[debug] 2: /Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli
[debug] ScriptingSupport: givenScriptName:
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli
[debug] ScriptingSupport: Trying to run script:
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli/click_safenotes.py
[debug] ScriptingSupport: initScriptingSupport: enter
[debug] JythonSupport: init: starting
[debug] JythonSupport: init: success
[debug] JythonSupport: ***** Jython sys.path
 0: /Users/shareduser/Library/Application Support/Sikulix/Lib
 1: /Applications/SikuliX.app/Contents/Java/Lib
 2: /Applications/SikuliX.app/Contents/Java/sikulix.jar/Lib
 3: __classpath__
 4: __pyclasspath__/
[debug] JythonSupport: ***** Jython sys.path end
[debug] Jython: sikuli: Sikuli: starting init
[debug] RunTimeIDE: loadLib: libVisionProxy.dylib
[debug] RunTimeIDE: loadLib: libMacUtil.dylib
[debug] Jython: requested to use as default region: S(0)[0,0 1x1]
[debug] Jython: sikuli: Sikuli: ending init
[debug] JythonScriptRunner: running Jython 2.7.1 
[debug] ScriptingSupport: initScriptingSupport: added: jython
[debug] ScriptingSupport: initScriptingSupport: exit with defaultrunner: jython (py)
[debug] ImagePath: new BundlePath:
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli/
[debug] Jython: requested to use as default region: S(0)[0,0 1x1]
[debug] JythonScriptRunner: runPython: running script: 
/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli
[debug] Image: loaded: 1522143552641.png (file:/Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli/1522143552641.png)
[debug] Image: cached: 1522143552641.png (6 KB) (# 1 KB 6 -- 0 % of 64 MB)
[debug] Region: wait: waiting 3.0 secs for 1522143552641.png to appear in S(0)[0,0 1x1]
[error] script [ /Users/shareduser/PycharmProjects/RF_Mac_Tests/pages/editor/sikuli/click_safenotes.sikuli ] stopped with error in line 1
[error] java.lang.NullPointerException ( java.lang.NullPointerException )
[debug] RunTimeIDE: final cleanup
[debug] FileManager: deleteFileOrFolder:
/var/folders/31/srmmps8x0td7l97qp41d5_dw0000gp/T/Sikulix_839020385


Looks like the problem caused by Jython using default region: S(0)[0,0
1x1] when running via ssh (and when the script is run directly, the
default region is correct: S(0)[0,0 1680x1050])

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