KB-1476 StackOverflowError thrown during WebLogic startup

Symptoms

WebLogic gets stuck on startup and prints the following errors in the application server log:

Error creating bean with name 'smartServiceBridgeRegistry' defined in class path resource [com/appiancorp/expr/server/reaction/ReactionSpringConfig.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [com.appiancorp.core.expr.reaction.ReactionFunctionProvider]: : 
Error creating bean with name 'reactionFunctionProvider' defined in class path resource [com/appiancorp/expr/server/reaction/ReactionSpringConfig.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.List]: :
Error creating bean with name 'importReaction' defined in class path resource [com/appiancorp/object/action/ObjectActionSpringConfig.class]: Unsatisfied dependency expressed through constructor argument with index 4 of type [com.appiancorp.ix.activity.IxActivityService]: :
Error creating bean with name 'ixActivityService' defined in class path resource [com/appiancorp/ix/spring/IxActivitySpringConfig.class]: Unsatisfied dependency expressed through constructor argument with index 4 of type [com.appiancorp.type.config.plugin.PojoDatatypesConfig]: :
Error creating bean with name 'pojoDatatypesConfig' defined in class path resource [com/appiancorp/type/TypeSpringConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.appiancorp.type.config.plugin.PojoDatatypesConfig]: Factory method 'pojoDatatypesConfig' threw exception; nested exception is java.lang.StackOverflowError

Cause

StackOverflow errors are usually caused by unterminated recursion, where the same errors are being repeated over and over again. This can also happen for valid configurations if the JVM stack size is too small.

Action

Increase the JVM stack size. Set -Xss or -XX:ThreadStackSize to 4 Megabytes.

Linux:

  1. Open <WEBLOGIC_HOME>/<project_name>/domains/<domain_name>/bin/setDomainEnv.sh and locate the following line: JAVA_OPTIONS="${JAVA_OPTIONS}"
  2. Update the line as follows: JAVA_OPTIONS="${JAVA_OPTIONS} -Xss4m"
  3. Restart WebLogic to deploy the change.

Windows:

  1. Open <WEBLOGIC_HOME>/<project_name>/domains/<domain_name>/bin/setDomainEnv.bat and locate the following line: set JAVA_OPTIONS=%JAVA_OPTIONS%
  2. Update the line as follows: set JAVA_OPTIONS=%JAVA_OPTIONS% -Xss4m
  3. Restart WebLogic to deploy the change.

Note: If stack overflow errors are still present when the JVM stack size is set to 4MB then increasing the stack further is unlikely to resolve the issue. Examine the stack trace to get insight on why long stack traces are being printed (usually something in the environment is performing a high level of recursion).

Note: If the issue is resolved after increasing the stack size to 4MB, reduce the JVM stack as much as possible without triggering the error as setting the stack size unnecessarily high may have a performance impact. In previous tests, 512K has been seen to be optimum. However, every environment is unique and extensive testing is recommended before pushing any changes to production.

Affected Versions

This article applies to all versions of Appian using WebLogic as the application server.

Last Reviewed: January 2018

Related
Recommended