Picked up JDK_JAVA_OPTIONS: appearing in my servlets log file?

738 Views Asked by At

I have a servlet running in Tomcat on a server. One of the tasks the servlet does is transform documents using a translation library jar. Executing a java -jar "..." command.

I use log4j to log the actions a sample below.

[echo] [init] Initialize build space 
[echo] build.web.dir= /home/scott/workspace/mbel-work/tei2html/build/web teiFile=A10007 docName=A10007.xml
[echo] [tei-doc-to-html] Building html documents production=no
[echo] "/home/scott/workspace/mbel-work/tei2html/build/web/A10007/A10007.html is up to date!"
[echo] [tei-to-html] Build index.html, searchsite.html and solrsearch.html files

I upgraded java and now I see this.

[echo] [init] Initialize build space 
[echo] build.web.dir= /home/scott/workspace/mbel-work/tei2html/build/web teiFile=A10011
docName=A10011.xml
[echo] [tei-doc-to-html] Building html documents production=yes
[java] 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
[echo] [tei-to-html] Build index.html, searchsite.html and solrsearch.html files 
[java] 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
[java] 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
[java] 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

Why is this showing up in my custom log file?

Here is the code to create the logger and the call to log the message, the "Picked up..." is not in the message.

// create the new logger
    builder.add(builder.newLogger("BuildLogger", Level.OFF)
            .add(builder.newAppenderRef("rolling"))
            .addAttribute("additivity", false));

    /*builder.add(builder.newRootLogger(Level.DEBUG)
            .add(builder.newAppenderRef("rolling")));
    */
    ctx = Configurator.initialize(builder.build());
    LOGGER = LogManager.getLogger("BuildLogger");
    setup = true;
    //System.out.println("BuildLog.init: exit");
}

public static void userLog(String message) {
    if (setup == false) {
        init();
    }
    LOGGER.info(message);
}

Any way I can suppress this?

I did notice the Tomcat is setting these in the run script

# Add the JAVA 9 specific start-up parameters required by Tomcat
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.io=ALL-UNNAMED"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
export JDK_JAVA_OPTIONS

I'm sure its no coincidence that these are the same options now showing up in my log file. Though it didn't happen until I upgraded Java.

1

There are 1 best solutions below

0
On

I moved the logging function down into the Ant script that was being called.

No problem now.