RaiMan / SikuliX1

SikuliX version 2.0.0+ (2019+)
https://sikulix.github.io
MIT License
2.79k stars 357 forks source link

Exception in thread "Thread-22" java.lang.ExceptionInInitializerError #609

Closed senaslanugur closed 10 months ago

senaslanugur commented 12 months ago

Hello, I have some problem with Sikulix IDE. When i run the sikulix ide, i get this message.

Exception in thread "Thread-22" java.lang.ExceptionInInitializerError at org.python.util.PythonInterpreter.(PythonInterpreter.java:99) at org.python.util.PythonInterpreter.(PythonInterpreter.java:93) at org.python.util.PythonInterpreter.(PythonInterpreter.java:70) at org.sikuli.script.runnerSupport.JythonSupport.init(JythonSupport.java:93) at org.sikuli.script.runnerSupport.JythonSupport.get(JythonSupport.java:66) at org.sikuli.script.runners.JythonRunner.doInit(JythonRunner.java:87) at org.sikuli.script.runners.AbstractScriptRunner.init(AbstractScriptRunner.java:70) at org.sikuli.ide.EditorPane$2.run(EditorPane.java:360) Caused by: java.lang.IllegalArgumentException: Cannot create PyString with non-byte value at org.python.core.PyString.(PyString.java:57) at org.python.core.PyString.(PyString.java:70) at org.python.core.PyString.(PyString.java:74) at org.python.core.Py.newString(Py.java:643) at org.python.core.PyJavaType.init(PyJavaType.java:543)

at org.python.core.PyType$Registry.createType(PyType.java:477)
at org.python.core.PyType$Registry.addFromClass(PyType.java:426)
at org.python.core.PyType$Registry.resolveType(PyType.java:352)
at org.python.core.PyType$Registry$1.computeValue(PyType.java:208)
at org.python.core.PyType$Registry$1.computeValue(PyType.java:202)
at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:228)
at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:210)
at java.base/java.lang.ClassValue.get(ClassValue.java:116)
at org.python.core.PyType.fromClass(PyType.java:2137)
at org.python.core.PyObject.<init>(PyObject.java:85)
at org.python.core.PySingleton.<init>(PySingleton.java:9)
at org.python.core.PyNotImplemented.<init>(PyNotImplemented.java:10)
at org.python.core.Py.<clinit>(Py.java:66)
... 8 more

My System: Sikulix: SikulixIDE-2.0.5 Java: openjdk version "11.0.21" 2023-10-17 OpenJDK Runtime Environment Temurin-11.0.21+9 (build 11.0.21+9) OpenJDK 64-Bit Server VM Temurin-11.0.21+9 (build 11.0.21+9, mixed mode)

senaslanugur commented 12 months ago

and Win 10.

RaiMan commented 10 months ago

start the IDE from commandline using:

java - jar sikulix.... -v -c

where java must be the Java 11 executable and sikulix.... the absolute filename of the SikuliX IDE jar-file.

The log output should show more about where the IDE hangs.

senaslanugur commented 10 months ago

C:\Windows\Sikulix>java --version java 11.0.20 2023-07-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.20+9-LTS-256) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.20+9-LTS-256, mixed mode)

C:\Windows\Sikulix>java -jar sikulixide-2.0.5.jar -v -c [DEBUG]startUp: IDE: Running: C:\Windows\Sikulix\sikulixide-2.0.5.jar [DEBUG]startUp: IDE: AppData: C:\Users\US\AppData\Roaming\Sikulix [DEBUG]startUp: IDE: starting with classpath: sikulixide-2.0.5.jar ... [DEBUG]startUp: IDE: no extensions.txt nor valid content [332 debug] RunTime:temp folder ok: C:\Users\US\AppData\Local\Temp\Sikulix_657798486 Options: options dump Options: testing = Options: OptionsFile = C:\Users\US\AppData\Roaming\Sikulix\SikulixStore\SikulixOptions.txt Options: options dump end ** show environment for 2.0.5 API user.home: C:\Users\US work dir: C:\Windows\Sikulix running on Windows 10.0 from a jar running Java Oracle Corporation 11.0.20+9-LTS-256 java.io.tmpdir: C:\Users\US\AppData\Local\Temp app data folder: C:\Users\US\AppData\Roaming\Sikulix executing jar: C:\Windows\Sikulix\sikulixide-2.0.5.jar classpath dump sikulix 0: sikulixide-2.0.5.jar * classpath dump end *** show environment end [DEBUG]startUp: IDE: ***** leaving start [39 debug] Sikulix: starting IDE [77 debug] RunTime:temp folder ok: C:\Users\US\AppData\Local\Temp\Sikulix_487348235 Options: * options dump Options: testing = Options: OptionsFile = C:\Users\US\AppData\Roaming\Sikulix\SikulixStore\SikulixOptions.txt Options: * options dump end *** show environment for 2.0.5 IDE user.home: C:\Users\US work dir: C:\Windows\Sikulix running on Windows 10.0 from a jar running Java Oracle Corporation 11.0.20+9-LTS-256 java.io.tmpdir: C:\Users\US\AppData\Local\Temp app data folder: C:\Users\US\AppData\Roaming\Sikulix executing jar: C:\Windows\Sikulix\sikulixide-2.0.5.jar classpath dump sikulix 0: C:\Windows\Sikulix\sikulixide-2.0.5.jar 1: sikulixide-2.0.5.jar classpath dump end ** show environment end [325 debug] IDE: running with Locale: en_US [DEBUG]startUp: IDE: --- Sikuli parameters --- [DEBUG]startUp: IDE: 1: -v [DEBUG]startUp: IDE: 2: -c [341 debug] HotkeyManager: add Capture Hotkey: CTRL+SHİFT 2 (50, 3) [757 debug] HotkeyManager: add Abort Hotkey: ALT+SHİFT C (67, 9) [757 debug] IDE: Init ScriptingSupport [765 debug] IDESupport: enter [3175 debug] Runner: added: PackedSikulix [skl] text/skl [3175 debug] Runner: added: PackedSikulix [zip] application/zip [3183 debug] Runner: added: NetworkRunner [] NET [3183 debug] Runner: added: PowerShell [ps1] text/powershell [3183 debug] Runner: added: Text [txt] text/text [3183 debug] Runner: init: class org.sikuli.script.runners.AbstractLocalFileScriptRunner: warning: not possible [3183 debug] Runner: added: SikulixJar [jar] text/jar [3191 debug] Runner: added: Jython [py] text/jython [3191 debug] Runner: added: SikulixExecutableJar [executablejar] text/jar [3199 debug] Runner: added: Sikulix [] directory/sikulix [3205 debug] IDESupport: added: Jython [3205 debug] IDESupport: added: Text [3205 debug] IDESupport: exit: defaultrunner: Jython (py) [3213 debug] IDE: Reading Preferences [3213 debug] IDE: Adding components to window [3229 debug] IDE: [I18N] menuRecent [3253 debug] IDE: [I18N] menuToolAndroid [3253 debug] IDE: creating tabbed editor [3378 debug] IDE: creating message area [3458 debug] IDE: creating combined work window [3458 debug] IDE: Putting all together [3458 debug] IDE: Putting all together - after main pane [3546 debug] IDE: Putting all together - after toolbar [3546 debug] IDE: Putting all together - before layout [3618 debug] IDE: Putting all together - after layout [3618 debug] IDE: Putting all together - Restore last Session [3634 debug] EditorPane: created 1705247868627 [3650 debug] JythonRunner: starting initialization [3670 debug] EditorPane: InitTab: (text/jython) [3686 debug] ImagePath: new BundlePath: C:\Users\US\AppData\Local\Temp\Sikulix_487348235\SikulixIDETempTab1705247868627 [3694 debug] Screen: initScreens: starting [3702 debug] Screen: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment() [3702 debug] Screen: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() [3702 debug] Screen: ScreenDevice 0 has (0,0) --- will be primary Screen(0) [3702 debug] Screen: Monitor 0: (0, 0) 1536 x 864 [3702 debug] Screen: initScreens: monitor mouse check [3729 debug] Screen: checking: R[0,0 1536x864]@S(0) center: (768, 432) --- OK [3743 debug] Screen: initScreens: ending [3743 debug] IDE startup: 3,7 seconds *** Running on Java 9+

senaslanugur commented 10 months ago

This is error on my code (print("test"))

[<debug] IDE: MenuAction.doSave [debug] SikulixFileChooser: Save at C:\Users\US\Desktop [debug] EditorPane: saveAsBundle: to: C:\Users\US\Desktop\ugur_test.sikuli [debug] EditorPane: saveAsBundle: from: C:\Users\US\AppData\Local\Temp\Sikulix_487348235\SikulixIDETempTab1705247868627 [debug] FileManager: deleteFileOrFolder: C:\Users\US\AppData\Local\Temp\Sikulix_487348235\SikulixIDETempTab1705247868627 [debug] ImagePath: new BundlePath: C:\Users\US\Desktop\ugur_test.sikuli [debug] EditorPane: setFiles: for: C:\Users\US\Desktop\ugur_test.sikuli [debug] EditorPane: writeSrcFile: C:\Users\US\Desktop\ugur_test.sikuli\ugur_test.py [debug] EditorPane: cleanBundle [debug] FileManager: slashify: file: C:/Users/US/Desktop/ugur_test.sikuli [debug] EditorPane: parseforImages: in C:/Users/US/Desktop/ugur_test.sikuli [debug] EditorPane: parseforImages finished [debug] EditorPane: cleanBundle finished [debug] JythonRunner: starting initialization [debug] Jython: added as Jython::sys.path[0]: C:\Users\US\AppData\Roaming\Sikulix\Lib\site-packages [debug] Jython: sys.path 0: C:\Users\US\Desktop\ugur_test.sikuli 1: C:\Users\US\AppData\Roaming\Sikulix\Lib\site-packages 2: C:\Users\US\AppData\Roaming\Sikulix\Lib [error] IDE: Run Script: internal error: [debug] RunTime: running cleanUp [debug] JythonRunner: starting initialization [debug] Jython: added as Jython::sys.path[0]: C:\Users\US\AppData\Roaming\Sikulix\Lib\site-packages [debug] Jython: sys.path 0: C:\Users\US\Desktop\ugur_test.sikuli 1: C:\Users\US\AppData\Roaming\Sikulix\Lib\site-packages 2: C:\Users\US\AppData\Roaming\Sikulix\Lib [error] IDE: Run Script: internal error: [debug] RunTime: running cleanUp

RaiMan commented 10 months ago

There is something wrong with the Jython init at startup, since a message like

[4102 debug] JythonRunner: ready: version 2.7.2

is missing some additional lines after

[3743 debug] IDE startup: 3,7 seconds *** Running on Java 9+

This might mean, that the Jython startup in parallel does not get finished.

Also the messages at script run are different:

[debug] JythonRunner: starting initialization

the latest SX 2.0.5 says:

[debug] Jython: SikulixForJython: init: starting

Conclusion: are you sure you have the latest SX 2.0.5 jar?

senaslanugur commented 10 months ago

I downloaded and use the latest version of SX from this link https://launchpad.net/sikuli/sikulix/2.0.5/+download/sikulixide-2.0.5.jar.

RaiMan commented 10 months ago

Could you please download and use the version slimmed for use with Windows only (this is what I am using on Windows):

https://launchpad.net/sikuli/sikulix/2.0.5/+download/sikulixide-2.0.5-win.jar

Please check wether you get the Jython ready message.

senaslanugur commented 10 months ago

i downloaded from link and run jar file with double click. I got the same error. I also get the following log when I run it in debug mode.

C:\Windows\Sikulix>java -jar sikulixide-2.0.5-win.jar -v -c [DEBUG]startUp: IDE: Running: C:\Windows\Sikulix\sikulixide-2.0.5-win.jar [DEBUG]startUp: IDE: AppData: C:\Users\US\AppData\Roaming\Sikulix [DEBUG]startUp: IDE: starting with classpath: sikulixide-2.0.5-win.jar ... [DEBUG]startUp: IDE: no extensions.txt nor valid content [125 debug] RunTime:temp folder ok: C:\Users\US\AppData\Local\Temp\Sikulix_337908998 Options: options dump Options: testing = Options: OptionsFile = C:\Users\US\AppData\Roaming\Sikulix\SikulixStore\SikulixOptions.txt Options: options dump end ** show environment for 2.0.5 API user.home: C:\Users\US work dir: C:\Windows\Sikulix running on Windows 10.0 from a jar running Java Oracle Corporation 11.0.20+9-LTS-256 java.io.tmpdir: C:\Users\US\AppData\Local\Temp app data folder: C:\Users\US\AppData\Roaming\Sikulix executing jar: C:\Windows\Sikulix\sikulixide-2.0.5-win.jar classpath dump sikulix 0: sikulixide-2.0.5-win.jar * classpath dump end *** show environment end [DEBUG]startUp: IDE: ***** leaving start [16 debug] Sikulix: starting IDE [16 debug] RunTime:temp folder ok: C:\Users\US\AppData\Local\Temp\Sikulix_656374286 Options: * options dump Options: testing = Options: OptionsFile = C:\Users\US\AppData\Roaming\Sikulix\SikulixStore\SikulixOptions.txt Options: * options dump end *** show environment for 2.0.5 IDE user.home: C:\Users\US work dir: C:\Windows\Sikulix running on Windows 10.0 from a jar running Java Oracle Corporation 11.0.20+9-LTS-256 java.io.tmpdir: C:\Users\US\AppData\Local\Temp app data folder: C:\Users\US\AppData\Roaming\Sikulix executing jar: C:\Windows\Sikulix\sikulixide-2.0.5-win.jar classpath dump sikulix 0: C:\Windows\Sikulix\sikulixide-2.0.5-win.jar 1: sikulixide-2.0.5-win.jar classpath dump end ** show environment end [125 debug] IDE: running with Locale: en_US [DEBUG]startUp: IDE: --- Sikuli parameters --- [DEBUG]startUp: IDE: 1: -v [DEBUG]startUp: IDE: 2: -c [141 debug] HotkeyManager: add Capture Hotkey: CTRL+SHİFT 2 (50, 3) [300 debug] HotkeyManager: add Abort Hotkey: ALT+SHİFT C (67, 9) [300 debug] IDE: Init ScriptingSupport [300 debug] IDESupport: enter [1290 debug] Runner: added: PackedSikulix [skl] text/skl [1290 debug] Runner: added: PackedSikulix [zip] application/zip [1290 debug] Runner: added: NetworkRunner [] NET [1290 debug] Runner: added: PowerShell [ps1] text/powershell [1290 debug] Runner: added: Text [txt] text/text [1290 debug] Runner: init: class org.sikuli.script.runners.AbstractLocalFileScriptRunner: warning: not possible [1290 debug] Runner: added: SikulixJar [jar] text/jar [1306 debug] Runner: added: Jython [py] text/jython [1306 debug] Runner: added: SikulixExecutableJar [executablejar] text/jar [1306 debug] Runner: added: Sikulix [] directory/sikulix [1306 debug] IDESupport: added: Jython [1306 debug] IDESupport: added: Text [1306 debug] IDESupport: exit: defaultrunner: Jython (py) [1306 debug] IDE: Reading Preferences [1306 debug] IDE: Adding components to window [1306 debug] IDE: [I18N] menuRecent [1321 debug] IDE: [I18N] menuToolAndroid [1321 debug] IDE: creating tabbed editor [1384 debug] IDE: creating message area [1416 debug] IDE: creating combined work window [1416 debug] IDE: Putting all together [1416 debug] IDE: Putting all together - after main pane [1462 debug] IDE: Putting all together - after toolbar [1462 debug] IDE: Putting all together - before layout [1478 debug] IDE: Putting all together - after layout [1478 debug] IDE: Putting all together - Restore last Session [1478 debug] IDE: Restore scripts from last session [1494 debug] EditorPane: created 1705255345104 [1494 debug] JythonRunner: starting initialization [1509 debug] EditorPane: InitTab: (text/jython) [1525 debug] ImagePath: new BundlePath: C:\Users\US\AppData\Local\Temp\Sikulix_656374286\SikulixIDETempTab1705255345104 [1525 debug] Screen: initScreens: starting [1525 debug] Screen: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment() [1525 debug] Screen: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() [1525 debug] Screen: ScreenDevice 0 has (0,0) --- will be primary Screen(0) [1525 debug] Screen: Monitor 0: (0, 0) 1536 x 864 [1525 debug] Screen: initScreens: monitor mouse check [1548 debug] Screen: checking: R[0,0 1536x864]@S(0) center: (768, 432) --- OK [1562 debug] Screen: initScreens: ending [1562 debug] IDE startup: 1,6 seconds *** Running on Java 9+

senaslanugur commented 10 months ago

I figured out where the problem is coming from :) it gives this error if the computer language is any other language than english. My computer language was Turkish, I fixed it by changing it to English :) Thank you for your help. Best regards.