I have a PC which runs Lubuntu 14.10 without a monitor. The user is autologged in. I have created a Sysvinit script and installed it on /etc/init.d. My script amongst other things, starts a jar file that opens a GUI application that listens on serial port.
The problem is that I can't make the jar application start automatically on boot. Java complains that it cannot connect to the X11 display server. However this is the strange thing. If I ssh into the machine and run the script myself with sudo service it starts normally. Also if I have a monitor connected during boot, it also starts correctly by itself.
How can I get the script started without a monitor connected? It seems as if when a monitor is not connected, Xorg server isn't initiated.