[Geoserver-devel] Page Server Status with Error 500

Hi All,

I am testing GeoServer in the following environment:

O.S: Windows 10 Home (Version 21H2)
Java: OpenJDK 17.0.2
GeoServer 2.22.1 (Platform Independent Binary)

The first error I noticed was on the Status server page. When clicking on the menu, it displays the screen:

image.png

(attachments)

image.png

···

HTTP ERROR 500 javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE

URI:

/geoserver/web/wicket/bookmarkable/org.geoserver.web.admin.StatusPage

STATUS:

500

MESSAGE:

javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE

SERVLET:

dispatcher

CAUSED BY:

javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE

CAUSED BY:

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE

CAUSED BY:

java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE

### Caused by:
javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:162)

The second mistake is when clicking on some layer in Layer Preview. It does not load the layer and the following error appears in the console:

image.png

When going back to Java 11 (JDK 11.0.2) everything works normally again.

Best regards,

Fernando Quadro
http://www.fernandoquadro.com.br
https://www.linkedin.com/in/fernandoquadro/

On Thursday, 2 February 2023 8:01:15 AM AEDT Fernando Quadro wrote:

I am testing GeoServer in the following environment:

O.S: Windows 10 Home (Version 21H2)
Java: OpenJDK 17.0.2
GeoServer 2.22.1 (Platform Independent Binary)

So JDK 17 is experimental.

Did you apply the required changes as shown at

https://docs.geoserver.org/2.22.x/en/user/production/java.html#running-on-java-17-experimental

?

Brad

An error like:

Could not initialize class java.awt.GraphicsEnvironment$LocalGE

makes me think the server is headless, and nothing told Java that was the case. Try adding “-Djava.awt.headless=true” among the java command line parameters
and see if that helps

Cheers
Andrea

(attachments)

image.png
image.png

···

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail

An error like:

Could not initialize class java.awt.GraphicsEnvironment$LocalGE

makes me think the server is headless, and nothing told Java that was the case. Try adding “-Djava.awt.headless=true” among the java command line parameters
and see if that helps

See also https://gis.stackexchange.com/questions/450957/geoserver-responding-an-error-occurred-while-loading-the-page-when-pressing-bu which is related to JAva 17 an the Marlin renderer

Ian

(attachments)

image.png
image.png

···

Ian Turton

Hi all,

I applied the settings from the link below, and everything is working normally with Java 17.

https://docs.geoserver.org/2.22.x/en/user/production/java.html#running-on-java-17-experimental

Thank you all.

Best regards,

(attachments)

image.png
image.png

···

Fernando Quadro
http://www.fernandoquadro.com.br
https://www.linkedin.com/in/fernandoquadro/