NullPointerException at java.util.logging.Logger.demandLogger

stefan.m

After upgrading from Java 6 to Java 8, my application throws the following exception:

com.mathworks.toolbox.javabuilder.MWException: Java exception occurred: 
java.lang.NullPointerException
    at java.util.logging.Logger.demandLogger(Logger.java:451)
    at java.util.logging.Logger.getLogger(Logger.java:502)
    at com.mathworks.toolbox.javabuilder.internal.MWMCR.mclFeval(Native Method)
    at com.mathworks.toolbox.javabuilder.internal.MWMCR.access$600(MWMCR.java:23)
    at com.mathworks.toolbox.javabuilder.internal.MWMCR$6.mclFeval(MWMCR.java:833)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.mathworks.toolbox.javabuilder.internal.MWMCR$5.invoke(MWMCR.java:731)
    at com.sun.proxy.$Proxy2.mclFeval(Unknown Source)
    at com.mathworks.toolbox.javabuilder.internal.MWMCR.invoke(MWMCR.java:406)
    at mDataEngine.mDataEngineMIF.volatility(mDataEngineMIF.java:7212)

This occurs when using the mathworks library, which in turn uses java.util.logging.Logger where the exception is thrown.

jmehrens

The Oracle bug JDK-8145302 NullPointerException at java.util.logging.Logger.demandLogger has been replaced with

JDK-8177325 Caller sensitive methods Logger.getLogger, Logger.getAnonymousLogger, will throw NPE if there is no caller on the stack.

The workaround in that bug report is listed as:

Workaround: use an auxiliary class in order to call Logger.getLogger instead of calling Logger::getLogger directly from JNI.

As you can see from your stacktrace:

java.lang.NullPointerException
at java.util.logging.Logger.demandLogger(Logger.java:451)
at java.util.logging.Logger.getLogger(Logger.java:502)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.mclFeval(Native Method) 
...

the com.mathworks.toolbox.javabuilder.internal.MWMCR.mclFeval is a JNI method calling java.util.logging.Logger.getLogger.

Mathworks should update the MWMCR class to include a java helper method to invoke getLogger and that helper method should be called from JNI instead of getLogger directly.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

printStackTrace to java.util.logging.Logger

From Dev

In java.util.logging, what is the global logger for?

From Dev

Java java.util.logging.logger. Using array objects as arguments

From Dev

How to use java.util.logging.Logger from different threads?

From Dev

Show java.util.logging.Logger logs in Android Studio logcat

From Dev

Why does java.util.logging.Logger print to stderr?

From Dev

Change color and format of java.util.logging.Logger output in Eclipse

From Dev

How to use java.util.logging.Logger from different threads?

From Java

Difference between java.util.logging.Logger and java.lang.System.Logger

From Dev

Difference between java.util.logging.Logger and java.lang.System.Logger

From Dev

java.util.logging.Logger has different Level than it's root Logger

From Dev

Java logging global logger

From Dev

Java logging global logger

From Dev

java.util.logging can't share the logger between two classes

From Dev

How can I output the name of the current java.util.logging.Logger log file name?

From Dev

How to map levels of java.util.logging and SLF4J logger?

From Dev

How can I output the name of the current java.util.logging.Logger log file name?

From Dev

Logging of file with java.util.logging and restlet

From Dev

Issue in Logging into files using Logger library in Java

From Java

Why not use java.util.logging?

From Dev

How to Mock java.util.logging

From Dev

Java Util Logging set FileHandler global

From Dev

java.util.logging.FileHandler clear logs

From Dev

java.util.logging does not exist bug?

From Dev

Java logging framework which does not require LOGGER declaration on every class

From Dev

java.lang.NoSuchMethodError: org/jboss/logging/Logger.debug

From Dev

LogManager Exception in JBOSS AS 7.1 with java.util.Logger

From Dev

Java.util.logger new file every day

From Dev

Java.util.logger Keeps writing to a new log file

Related Related

  1. 1

    printStackTrace to java.util.logging.Logger

  2. 2

    In java.util.logging, what is the global logger for?

  3. 3

    Java java.util.logging.logger. Using array objects as arguments

  4. 4

    How to use java.util.logging.Logger from different threads?

  5. 5

    Show java.util.logging.Logger logs in Android Studio logcat

  6. 6

    Why does java.util.logging.Logger print to stderr?

  7. 7

    Change color and format of java.util.logging.Logger output in Eclipse

  8. 8

    How to use java.util.logging.Logger from different threads?

  9. 9

    Difference between java.util.logging.Logger and java.lang.System.Logger

  10. 10

    Difference between java.util.logging.Logger and java.lang.System.Logger

  11. 11

    java.util.logging.Logger has different Level than it's root Logger

  12. 12

    Java logging global logger

  13. 13

    Java logging global logger

  14. 14

    java.util.logging can't share the logger between two classes

  15. 15

    How can I output the name of the current java.util.logging.Logger log file name?

  16. 16

    How to map levels of java.util.logging and SLF4J logger?

  17. 17

    How can I output the name of the current java.util.logging.Logger log file name?

  18. 18

    Logging of file with java.util.logging and restlet

  19. 19

    Issue in Logging into files using Logger library in Java

  20. 20

    Why not use java.util.logging?

  21. 21

    How to Mock java.util.logging

  22. 22

    Java Util Logging set FileHandler global

  23. 23

    java.util.logging.FileHandler clear logs

  24. 24

    java.util.logging does not exist bug?

  25. 25

    Java logging framework which does not require LOGGER declaration on every class

  26. 26

    java.lang.NoSuchMethodError: org/jboss/logging/Logger.debug

  27. 27

    LogManager Exception in JBOSS AS 7.1 with java.util.Logger

  28. 28

    Java.util.logger new file every day

  29. 29

    Java.util.logger Keeps writing to a new log file

HotTag

Archive