Erddap docker image java.awt.HeadlessException

11 views
Skip to first unread message

Léo Le Lonquer

unread,
Oct 25, 2024, 9:15:38 AMOct 25
to ERDDAP

Hello,

I’m upgrading the Erddap instance I manage through the provided docker image

I’m starting the docker container this way :

docker run --rm -it -p 8081:8080 --env ERDDAP_baseUrl="http://localhost:8081" axiom/docker-erddap:2.24-jdk21-openjdk

I can access the main page via http://localhost:8081/erddap and browse default datasets.
However, in the logs I get the following error :

java.awt.HeadlessException
 at java.desktop/sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:58)
 at java.desktop/sun.awt.image.SurfaceManager$ImageCapabilitiesGc.isAccelerated(SurfaceManager.java:203)
 at gov.noaa.pfel.coastwatch.sgt.SgtUtil.isBufferedImageAccelerated(SgtUtil.java:350)
 at gov.noaa.pfel.erddap.util.EDStatic.<clinit>(EDStatic.java:1913)
 at gov.noaa.pfel.erddap.Erddap.<init>(Erddap.java:204)
 at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
 at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
 at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
 at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:144)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:758)
 at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:575)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:115)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
 at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:731)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:663)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:904)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
 at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
 at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
 at java.base/java.lang.Thread.run(Thread.java:1583)

Erddap JAVA_OPTS :

ERDDAP Running with:  -server -Xms4G -Xmx4G -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true  -DerddapContentDirectory=/usr/local/tomcat/content/erddap/ -Djna.tmpdir=/tmp/ -Djava.security.egd=file:/dev/./urandom

I get the same error with a different image :

docker run --rm -it -p 8081:8080 --env ERDDAP_baseUrl="http://localhost:8081" axiom/docker-erddap:2.23-jdk17-openjdk

Erddap parameters :

ERDDAP Running with:  -server -Xms4G -Xmx4G -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true  -DerddapContentDirectory=/usr/local/tomcat/content/erddap/ -Djna.tmpdir=/tmp/ -Djava.security.egd=file:/dev/./urandom

Is it a bug or is there a parameter I can set to disable this error ?

Regards,

Léo

--

Léo Le Lonquer
Ingénieur Cloud pour la Science
Ifremer Centre Bretagne, 29280 Plouzané, France

sh...@axiomalaska.com

unread,
Oct 25, 2024, 12:35:47 PMOct 25
to ERDDAP
Hello,

You can safely ignore this error. I created a GitHub issue on the project tracker to modify the log output here:

https://github.com/ERDDAP/erddap/issues/220

Thank you,
Shane

Reply all
Reply to author
Forward
0 new messages