Geoserver does not start on tomcat 8 in linux environment. Spring bean creation of gml32FeatureTypeEncoder fires java.lang.StackOverflowError

Description

After running the application server, tomcat fails to initalize the 'geosever' context.
All log files are in the attachment.
The error is :
26 Jul 13:40:35 ERROR [context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gml32FeatureTypeEncoder' defined in URL [jar:file:/home/tomcat/apache-tomcat-8.5.4/webapps/geoserver/WEB-INF/lib/gs-wfs-2.9.0.jar!/applicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.wfs.xml.v1_1_0.XmlSchemaEncoder$V20]: Constructor threw exception; nested exception is java.lang.StackOverflowError
....

Environment

OS:
Oracle Linux Server release 7.2
--------------------------------------------------------------------------
GDAL:
gdal.x86_64 - 1.11.4-1.el7
gdal-java.x86_64 - 1.11.4-1.el7
---------------------------------------------------------------------------
JAVA:
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
JAI installed as it is described in documentation: http://docs.geoserver.org/stable/en/user/production/java.html
----------------------------------------------------------------------------
TOMCAT - tested with these versions:
apache-tomcat-7.0.70 - with java version 1.7
apache-tomcat-8.0.36
apache-tomcat-8.5.4
the content of used setenv.sh is:
#! /bin/sh
export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx4512m"
export CATALINA_OPTS="$CATALINA_OPTS -Xss256k"
export CATALINA_OPTS="$CATALINA_OPTS -XX:SoftRefLRUPolicyMSPerMB=36000"
export CATALINA_OPTS="$CATALINA_OPTS -XX:+UseG1GC"
export CATALINA_OPTS="$CATALINA_OPTS -server"
----------------------------------------------------------------------------
"data" folder is moved from <home>/<tomcat>/webapps/geoserver to <home>/geoserver_data
and GEOSERVER_DATA_DIR environment variable is created in .bash_profile file:
export JAVA_HOME=/usr/java/jdk1.8.0_91/
export GEOSERVER_DATA_DIR=/home/tomcat/geoserver_data
export GDAL_DATA=/usr/share/gdal
----------------------------------------------------------------------------
LIBRARIES:
jai_codec-1.1.3.jar, jai_core-1.1.3.jar, jai_imageio-1.1.jar
are removed from /<home>/<tomcat>/webapps/geoserver/WEB-INF/lib/
postgresql-9.4-1201-jdbc41.jar is moved from /<home>/<tomcat>/webapps/geoserver/WEB-INF/lib/ to /<home>/<tomcat>/lib/

Activity

Show:
Andrea Aime
July 26, 2016, 11:59 AM
Edited

This is happening because you reduced the default stack size down to a value that's too small: export CATALINA_OPTS="$CATALINA_OPTS -Xss256k"

From an Oracle FAQ:

"In Java SE 6, the default on Sparc is 512k in the 32-bit VM, and 1024k in the 64-bit VM. On x86 Solaris/Linux it is 320k in the 32-bit VM and 1024k in the 64-bit VM."

Please remove that custom setting and try again, I know we have both 2.8 and 2.9 deployed on Tomcat with Linux without any problem (Tomcat + Linux is actually the most common deploy situation, but we haven't had other reports like this one). Or is that XSS value a default for the Oracle Linux Server?

Andrea Aime
July 26, 2016, 12:01 PM

Also, please don't treat the ticket system as a support forum, ask on the user list before opening tickets. See guidelines at https://osgeo-org.atlassian.net/projects/GEOS/summary

Petyo Zafirov
July 26, 2016, 12:20 PM
Edited

Thanks Andrea, it works now.
The -Xss parameter becomes from some old tomcat configuration.
Sorry, but Issues tracker was the first choice I have seen on the main page of GeoServer.

Thanks for the quick response!

Andrea Aime
February 15, 2017, 11:47 AM

Mass closing all resolved issues not modified in the last 4 weeks

Not a Bug

Assignee

Unassigned

Reporter

Petyo Zafirov

Triage

None

Fix versions

None

Affects versions

Components

Priority

High
Configure