Introduction: Java-based middleware components such as Apache Tomcat and ORDS are highly dependent on correct JVM configuration. Misalignment between Java versions and heap settings can result in critical startup failures. This blog documents a real-world incident involving JVM heap and class compatibility errors and the steps taken to resolve it.
Error Message:
Invalid maximum heap size: -Xmx4096M
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Exception in thread “main” java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
Analysis:
The following were verified during analysis:
1. Active Java version used by Tomcat.
2. Tomcat startup scripts and environment inheritance.
3. Absence of a dedicated setenv.sh, causing Tomcat to rely on default JVM behavior.
4. ORDS configuration not being explicitly passed during startup.
Resolution:
Step 1: Stop Tomcat Services
[DBA_RUN]$ sh shutdown.sh
dbaerp@ebsdba:/s01/ EBS-DBAERP /apex_dir/apache-tomcat-9.0.111/bin
Ensure no residual Java processes remain before proceeding.
Step 2: Create setenv.sh for Controlled JVM Startup
A dedicated environment file was introduced to explicitly control JVM behavior, heap sizing, and ORDS configuration.
cd /u01/EBS-DBAERP/apex_dir/apache-tomcat-9.0.111/bin
vi setenv.sh
Contents:
export ORDS_CONFIG=/u01/EBS-DBAERP/apex_dir/ords_24/config
export JAVA_OPTS=”-Dconfig.url=${ORDS_CONFIG} -Xms2048M -Xmx4096M”
Step 3: Confirm Correct Java Runtime
Tomcat was verified to use a 64-bit Java 17 runtime, fully compatible with Tomcat 9.x:
Using JRE_HOME: /u01/EBS-DBAERP/apex_dir/jdk-17.0.17
[DBA_RUN]$ export PATH=/s01 EBS-DBAERP /apex_dir/jdk-17.0.17/bin:$PATH
dbaerp@ebsdba:/s01/EBS-DBA/apex_dir
Step 4: Start Tomcat
[DBA_RUN]$ sh startup.sh
Using CATALINA_BASE: /s01/EBS-DBA/apex_dir/apache-tomcat-9.0.111
Using CATALINA_HOME: /s01/EBS-DBA/apex_dir/apache-tomcat-9.0.111
Using CATALINA_TMPDIR: /s01/EBS-DBA/apex_dir/apache-tomcat-9.0.111/temp
Using JRE_HOME: /s01/EBS-DBA/apex_dir/jdk-17.0.17
Using CLASSPATH: /s01/EBS-DBA/apex_dir/apache-tomcat-9.0.111/bin/bootstrap.jar:/s01/EBS-DBA/apex_dir/apache-tomcat-9.0.111/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
Conclusion:
This issue highlights how small JVM misalignments can cause complete middleware outages. The resolution was not increasing memory blindly, but enforcing JVM discipline and startup control.
By introducing a clean setenv.sh and validating Java compatibility, Tomcat and ORDS were restored successfully without impacting application integrity.