7

Odd issue I've come across with Tomcat 8.5 using JDK10. It starts up fine but when issuing shutdown I am confronted with this Note:

NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

The java process remains running thus prompting me to kill the PID in order to stop it.

Anyone have info on this what I need to do to resolve?

Thanks!

kipper3d
  • 81
  • 1
  • 1
  • 2
  • 1
    https://stackoverflow.com/a/12577771/330315 –  Sep 01 '18 at 16:30
  • 1
    This note means that someone has JDK_JAVA_OPTIONS variable to the value you see in the message. Are you sure it's printed at shutdown time? If so then it means that something is starting a VM at that time and it is picking up the value of this variable. As to the value then the --add-open options suggests that something (Tomcat?) must be hacking into JDK internals. I hope the Tomcat (or whoever) have an issue open to fix that. – Alan Bateman Sep 02 '18 at 06:48
  • This is a clean installation of tomcat 8.5 right from tomcat.apache.org Heres the JAVA_OPTS config i setup in setenv.sh: export JAVA_HOME=/usr/java/jdk10 JAVA_OPTS="-Xms64M -Xmx64M -server -XX:+UseParallelGC" export JAVA_HOME JAVA_OPTS – kipper3d Sep 02 '18 at 13:55
  • OpenJDK 11 is doing the same thing. NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED – kipper3d Oct 29 '18 at 00:40

2 Answers2

0

Feature, not a bug

According to this mailing list thread, the messages refer to options set by Tomcat when running on Java 9 and later to maintain important features (memory leak prevention/detection) in the face of the changes within Java. I presume the changes are related to the Java Platform Module System.

So this is a feature, not a bug.

The java process remains running

I do not see this behavior when running Java 13.0.1 from AdoptOpenJDK on macOS Mojave. After executing shutdown.sh with Tomcat 9.0.27, I find no java processes listed in Activity Monitor.app.

I suspect your java process continuing is due to some other cause. For example, speaking from experience, the thread pool of an executor service not being shut down.

When quitting Tomcat 9, I do get a message similar to what you posted:

NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
  • @basil_bourque so there is no such "fix" that can resolve this message. That sad and a bit ignorance from 'the developers'. – Pranav Jan 21 '20 at 08:41
0

I had the same problem. I went to the tomcat logs with the command line:

$ sudo tail -f / opt / tomcat / log / catalina.out

while restarting the service look at the latest messages.

One solution is to comment on the line:

Environment = 'CATALINA_OPTS = -Xms512M -Xmx1024M -server -XX: + UseParallelGC'

from thetomcat.service daemon and restart the service. This line controls the memory allocated and blocks the rise of the service. That's works for me, and I'll use Tomcat only for local testing and learn, not as real servlet server it doesn't matter for me, but I think it's not ideal solution for a real production Tomcat.

It may also be helpful to check the Apache2 error logs the with the same command that I use with catalina.out.

I hope it will be useful for somebody else.