0

I recently upgraded Java and now Tomcat service won't start. This is on an Ubuntu 16.04 LTS server. Tomcat is version 8.5. I upgraded from Java 7 to Java 11, Azul Zulu 7 to Azul Zulu 11. When running systemctl status tomcat85 I see the following not particularly helpful output:

enter image description here

Although the service won't seem to work, I can start Tomcat manually with the following command:

/opt/tomcat85/bin/startup.sh

These are the contents of the service file:

[Unit]
Description=Apache Tomcat 8.5 Servlet Container
After=syslog.target network.target

[Service]
User=tomcat85
Group=tomcat85
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/zulu-11-amd64
Environment=CATALINA_PID=/opt/tomcat85/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat85
Environment=CATALINA_BASE=/opt/tomcat85
EnvironmentFile=/etc/default/tomcat85
WorkingDirectory=/opt/tomcat85
ExecStart=/opt/tomcat85/bin/startup.sh
ExecStop=/opt/tomcat85/bin/shutdown.sh
#Restart=on-failure
StandardOutput=syslog
StandardError=syslog
LimitNOFILE=65536
SyslogIdentifier=tomcat85

[Install]
WantedBy=multi-user.target

Running journalctl -xe provides no meritorious information.

catalina.out reveals the following error:

enter image description here

I'm not sure where to go next with troubleshooting this issue. There are several seemingly related discussions on Stack but none have provided a solution as of yet. Any help is appreciated and I'm happy to add more information as requested.

Gedalya
  • 899
  • 4
  • 16
  • 28
  • Check if under `/usr/lib/jvm/zulu-11-amd64` is a complete JDK11. What gives `$ /usr/lib/jvm/zulu-11-amd64/bin/java -version`. – PeterMmm Feb 05 '23 at 18:03
  • @PeterMmm thank you. I ran the command and it gave the following output: `openjdk version "11.0.18" 2023-01-17 LTS`. – Gedalya Feb 05 '23 at 22:29
  • 1
    Nothing interesting in `/opt/tomcat85/logs` or syslog ? – PeterMmm Feb 06 '23 at 12:47
  • @PeterMmm, I just checked catalina.out and posted the error above: "Unrecognized VM option 'UseParNewGC'. – Gedalya Feb 06 '23 at 13:59
  • 1
    Search where does `UseParNewGC` comes from, refer to https://stackoverflow.com/questions/49962437/unrecognized-vm-option-useparnewgc-error-could-not-create-the-java-virtual for replacement. – samabcde Feb 06 '23 at 14:07

1 Answers1

0

I have found the answer thanks to some good feedback here in this post. The problem was several deprecated entries in the EnvironmentFile: /etc/default/tomcat85

JAVA_OPTS="-server -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseTLAB -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:PermSize=1024M -XX:MaxPermSize=1024m -Xms16384m -Xmx20480m"

One of the errant entries was: -XX:+UseParNewGC The updated entry is: -XX:+UseG1GC

Additionally the following entries needed to be removed: UseConcMarkSweepGC PermSize MaxPermSize

Gedalya
  • 899
  • 4
  • 16
  • 28