@Override
public StreamObserver<MdtDialoutArgs> mdtDialout(StreamObserver<MdtDialoutArgs> responseObserver) {
return new StreamObserver<MdtDialoutArgs>() {
@Override
public void onError(Throwable t) {
logger.warn( "Encountered error in mdtDialout");
}
@Override
public void onCompleted() {
responseObserver.onCompleted();
}
@Override
public void onNext(MdtDialoutArgs arg0) {
try {
....
....
...
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
Above code throws a java.lang.ArithmeticException without stack trace and without message. I am not creating/throwing empty ArithmeticException in the try block. What java method call/code can throw java.lang.ArithmeticException without stack trace and without error message?
And Has any one seen an ArithmeticException in java with no message before? Log output:
null java.lang.ArithmeticException
For some frequently thrown exceptions, JVM will make an optimization to hide the stack trace. When the server restart, the stack trace of this exception will show again.
Optimized version
java.lang.ArithmeticException: null
After restart
java.lang.ArithmeticException: / by zero at java.math.BigDecimal.divideAndRound(BigDecimal.java:4106) at java.math.BigDecimal.divide(BigDecimal.java:5153)
You can add VM option -XX:-OmitStackTraceInFastThrow to close this optimization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With