Vakeesar
Posts: 26
Joined: Thu Jun 11, 2015 1:49 pm

java.awt.HeadlessException:

Tue Feb 23, 2016 7:22 pm

I am trying to enable a 2-way Audio communication using Java Servlets between RPi and a windows machine. The same java program works fine between two windows 8 machines but not between a RPi and a window machine.It simply threw the following exception when invoked using a browser. How to deal with awt error? Also, he RPi does not have a mic

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
java.awt.Window.<init>(Window.java:536)
java.awt.Frame.<init>(Frame.java:420)
javax.swing.JFrame.<init>(JFrame.java:225)
com.teqnihome.tech.Client1.starter(Client1.java:55)
com.teqnihome.tech.Clientservlet.doGet(Clientservlet.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.24 logs.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: java.awt.HeadlessException:

Wed Feb 24, 2016 7:28 am

You need to start X via

Code: Select all

startx &
It does not matter whether a real display is connected or not.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Vakeesar
Posts: 26
Joined: Thu Jun 11, 2015 1:49 pm

Re: java.awt.HeadlessException:

Wed Feb 24, 2016 9:13 am

>>You need to start X via
Please Let me know in terms of how to Start X.

Return to “Java”