[1.1.1] new VNCScreen(): crashes with NPE
I am able to connect to the vnc socket, but after that the execution of
VNCScreen vnc = new VNCScreen() gives error :
Exception in thread "main" java.lang .ExceptionInIni
at run.main(
Caused by :java.lang.
at edu.unh.
at edu.unh.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
I am able to open up a VNC connection, but setting up VNCScreen gives an error !
Revision history for this message
|
#2 |
please post the complete initialization code
Revision history for this message
|
#3 |
import edu.unh.iol.dlc.*
public static.........
{
Socket s=new Socket(
s.setSoTimeout(
ConnectionContr
cc.openConnecti
cc.start(0);
-------
<Until this point code runs fine ,but after this line >
VNCScreen vnc= new VNCScreen() , generates an error
>Exception in thread "main" java.lang .ExceptionInIni
at run.main(
Caused by :java.lang.
at edu.unh.
at edu.unh.
So,is this caused by some issues in the VNCScreen.java file ?
Revision history for this message
|
#4 |
thanks.
--- So,is this caused by some issues in the VNCScreen.java file ?
... yes, I think the VNCScreen() constructor had a problem and I think I fixed it now.
please try this instead for now:
VNCScreen vnc= new VNCScreen(0);
... and when the fix is online later, I would appreciate if you try again with:
VNCScreen vnc= new VNCScreen();
Revision history for this message
|
#5 |
i tried using VNCScreen vnc= new VNCScreen(0); , but this doesn't work
Revision history for this message
|
#6 |
outcome?
run with -d 4 and post the log
Revision history for this message
|
#7 |
Connected[info] runcmd: lsb_release -i -r -s
Exception in thread "main" java.lang.
at run.main(
Caused by: java.lang.
at edu.unh.
at edu.unh.
... 1 more
Revision history for this message
|
#9 |
i haven't set the log label yet , i was running it on Eclipse
Revision history for this message
|
#10 |
i did try to run VNCScreen vnc = new VNCScreen() with the new fix available , and this is what i get :
[error] VNCScreen: initScreens: 0 has no connection yet
Exception in thread "main" java.lang.
at edu.unh.
at edu.unh.
at run.main(
Revision history for this message
|
#11 |
you have to wait:
the solution including some doc comments will be available with the next nightly build.
Revision history for this message
|
#12 |
ok, thank you can you plz tell me, by when it would be available ?
Revision history for this message
|
#13 |
on github later this day, the nightly tomorrow.
Revision history for this message
|
#15 |
I want to ask you about a different issue , just need your suggestion on that :
I am trying to package Sikuli as an rpm so I can distribute and deploy it in other systems.
Currently, I am facing difficulties, as the RPM cannot launch the UI that is popped up in Sikuli’s manual install.
Is there a silent installer for Sikuli and its dependencies?
If there isn’t, I can help create it – but will need pointers about what needs to be done.
Can you please let me know?
Revision history for this message
|
#16 |
--- silent setup:
faq 2609
--- VNC state
this is now available with the latest nightly build:
--- Python scripts:
vnc = vncStart(
tries a connection to a VNC server on the given IP using port 5900
the method doc:
## -------
# vncStart(
# convenience for a VNCScreen connection
# ip the server IP (default: 127.0.0.1)
# port the port number (default 5900)
# connectionTimeout seconds to wait for a valid connection (default 10)
# timeout the timout value in milli-seconds during normal operation (default 1000)
# returns a VNCScreen object
# use theVNCScreen.stop() to stop this connection again (auto-stopped at script end)
--- in Java
VNCScreen vnc = VNCScreen.
all parameters must be given, no defaults
on success, vnc can be used like a Screen object.
to stop a session:
vnc.stop()
this is tested from Mac to a TightVNC server on Windows
principally possible, but not yet tested: you can have more than one session (VNCScreens) in parallel
I will add more information in the docs:
http://
Revision history for this message
|
#17 |
Btw sir, i am still facing problem while running VNCScreen vnc=new VNCScreen() .
Revision history for this message
|
#18 |
OK thank you for the information :)
Revision history for this message
|
#19 |
I am running on RHEL and trying to connect to Tiger VNC :
VNCScreen vnc = VNCScreen.
Error:
[error] VNCScreen: initScreens: 0 has no connection yet
[error] VNCScreen: initScreens: 1 has no connection yet
Exception in thread "main" java.lang.
at edu.unh.
at edu.unh.
at edu.unh.
at test.main(
Revision history for this message
|
#20 |
can you please tell me about the java version you are running on . Are their any dependencies with java version ?
Revision history for this message
|
#21 |
for me everything works as expected.
Since I do not know, how exactly you are running your Java stuff:
put a
Debug.on(4)
just before the
VNCScreen vnc = VNCScreen.
to get more debug info.
I am usually running Oracle Java 8 latest build.
sure you are using the build from to night (2016-05-
Revision history for this message
|
#22 |
yes i am using the build from to night (2016-05-
Connected[debug] Debug.init: from sikuli.Debug: on: 4
*** system properties dump
awt.toolkit = sun.awt.
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.
java.awt.printerjob = sun.print.
java.class.path = /home/bhowmik/
java.class.version = 51.0
java.endorsed.dirs = /usr/lib/
java.ext.dirs = /usr/lib/
java.home = /usr/lib/
java.io.tmpdir = /tmp
java.library.path = /usr/java/
java.runtime.name = OpenJDK Runtime Environment
java.runtime.
java.specificat
java.specificat
java.specificat
java.vendor = Oracle Corporation
java.vendor.url = http://
java.vendor.url.bug = http://
java.version = 1.7.0_85
java.vm.info = mixed mode
java.vm.name = OpenJDK 64-Bit Server VM
java.vm.
java.vm.
java.vm.
java.vm.vendor = Oracle Corporation
java.vm.version = 24.85-b03
line.separator =
os.arch = amd64
os.name = Linux
os.version = 2.6.32-
path.separator = :
sun.arch.data.model = 64
sun.boot.class.path = /usr/lib/
sun.boot.
sun.cpu.endian = little
sun.cpu.isalist =
sun.desktop = gnome
sun.io.
sun.java.command = test
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = UTF-8
sun.management.
sun.os.patch.level = unknown
user.country = US
user.dir = /home/bhowmik/
user.home = /home/bhowmik
user.language = en
user.name = bhowmik
user.timezone = Asia/Kolkata
*** system properties dump end
[debug] RunTimeINIT: lsb_release -i -r -s
[debug] RunTimeINIT: loadOptions: check: /home/bhowmik/
[debug] RunTimeINIT: loadOptions: check: /home/bhowmik
[debug] RunTimeINIT: loadOptions: check: /home/bhowmik/
[error] Settings: load version file sikulixversion.txt did not work
[debug] Sikulix: endError: 999
[debug] Sikulix: cleanUp: 999
Exception in thread "main" java.lang.
at test.main(
Caused by: java.lang.
at java.util.
at edu.unh.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
... 1 more
Revision history for this message
|
#23 |
... and what if you run simply this:
Screen s = new Screen();
Debug.on(3)
VNCScreen vnc = VNCScreen.
... seems, that using Debug as the first Sikulix class makes a problem.
could you please tell me a bit more details about how you are running your java stuff.
Revision history for this message
|
#24 |
[info] runcmd: lsb_release -i -r -s
[debug] VNCScreen: VNCScreen: request for connection localhost:5903
[debug] java.io.
2[error] VNCScreen: initScreens: 0 has no connection yet
2[error] VNCScreen: initScreens: 1 has no connection yet
Exception in thread "main" java.lang.
at edu.unh.
at edu.unh.
at edu.unh.
at test.main(
Revision history for this message
|
#25 |
sure your TigerVNC allows loopback connections (in TightVNC you have to switch this on seperately)
Revision history for this message
|
#26 |
The java version I am using is 1.7.0_85. I am going to try with version 8 and report out what I see.
Btw, here's the java application that I've come up with. I am running into the errors above at the VNCScreen.start (commented below)
import java.io.
import java.net.Socket;
import org.sikuli.
import org.sikuli.
import edu.unh.
import edu.unh.
public class test {
public static void main(String[] args) {
try{
Socket s=new Socket(
//if(
// System.
// else
// System.
//s.
//s.
ConnectionCo
cc.openConne
cc.start(0);
Thread.
Screen S =new Screen();
Debug.on(3);
//VNCScreen vnc = VNCScreen.
// vnc.click();
}
catch(IOException | InterruptedExce
{
System.
}
}
}
Revision history for this message
|
#27 |
sorry, might not have been clear enough:
you either use the convenience VNCScreen.start() OR the detailed way with socket.
so a valid test would be:
import org.sikuli.
import org.sikuli.
import edu.unh.
public class test {
public static void main(String[] args) {
Screen S =new Screen();
Debug.on(3);
VNCScreen vnc = VNCScreen.
vnc.click(); // should click center of remote screen
}
Revision history for this message
|
#28 |
We have a emulator - qemu - that runs a virtual machine (linux). Qemu hosts a vncserver as a part of its process on a given port (5903 in the code above). We launch a vnc session into it using tigervnc viewer - this works well when we run it on the desktop.
I'll check if the issue exists with java 8 and report out.
Revision history for this message
|
#29 |
i did as you said, this is what i get :
debug] Debug.init: from sikuli.Debug: on: 3
[debug] RunTimeINIT: lsb_release -i -r -s
[debug] RunTimeINIT: loadOptions: check: /home/bhowmik/
[debug] RunTimeINIT: loadOptions: check: /home/bhowmik
[debug] RunTimeINIT: loadOptions: check: /home/bhowmik/
[debug] RunTimeINIT: global init: entering as: API
[debug] RunTimeINIT: ScreenDevice 0 has (0,0) --- will be primary Screen(0)
[debug] RunTimeINIT: Monitor 0: (0, 0) 1600 x 1200
[debug] RunTimeINIT: runs as sikulix.jar in: /home/bhowmik/
[debug] RunTimeINIT: exists libs folder at: /home/bhowmik/
***** show environment for API (build 201605271247)
user.home: /home/bhowmik
user.dir (work dir): /home/bhowmik/
user.name: bhowmik
java.io.tmpdir: /tmp
running 64Bit on Linux (0 RedHatEnterpris
java 8-64 version 1.8.0_51-b16 vm 25.51-b03 class 52.0 arch amd64
app data folder: /home/bhowmik/
libs folder: /home/bhowmik/
executing jar: /home/bhowmik/
*** classpath dump sikulix
1: /home/bhowmik/
*** classpath dump end
***** show environment end
[debug] RunTimeAPI: global init: leaving
[debug] RunTimeAPI: initAPI: entering
[debug] RunTimeAPI: resourceList: enter
[debug] RunTimeAPI: resourceLocation: (class org.sikuli.
[debug] RunTimeAPI: resourceList: having jar: jar:file:
[debug] RunTimeAPI: files exported: 7 from: Lib/sikuli to:
/home/
[debug] RunTimeAPI: initAPI: leaving
[debug] RunTimeAPI: loadLib: libVisionProxy.so
[debug] VNCScreen: VNCScreen: request for connection 127.0.0.1:5903
[debug] java.io.
[error] VNCScreen: initScreens: 0 has no connection yet
Error: java.lang.
Revision history for this message
|
#30 |
Ok, i could connect to the VNC session .
But in the VNC window vnc.click() doesn't clicks with in the VNC session window.
Revision history for this message
|
#31 |
LIke , i need to manually place the mouse pointer inside the VNC window , and then i could get a click.
Revision history for this message
|
#32 |
--- LIke , i need to manually place the mouse pointer inside the VNC window , and then i could get a click.
I guess this is a special problem of your special setup.
You have to find out yourself, since I do not have any chance to test that.
Revision history for this message
|
#33 |
I guess the original problem is solved now.
For new issues/questions please start a new thread.