I have a bug from my customer and when I look into the log we trace the exception, some of the stacktrace do not have line number:
at xxxx.xxx.xx.x.xx.DayIntervalRule.getInterval(DayIntervalRule.java)
at xxxx.xxx.xx.x.xx.XXSchedule.getNextDueDate(XXSchedule.java)
at xxxx.xxx.xx.x.xx.XXSchedule.evaluateRules(XXSchedule.java)
Please note that: I have replace the package name into something like"xx"),and all of the class and method are defined in our application:
The full stack trace are as below:
java.lang.NullPointerException
at xxxx.xxx.xx.x.xx.DayIntervalRule.getInterval(DayIntervalRule.java)
at xxxx.xxx.xx.x.xx.XXSchedule.getNextDueDate(XXSchedule.java)
at xxxx.xxx.xx.x.xx.XXSchedule.evaluateRules(XXSchedule.java)
at xxxx.xxx.xx.x.xx.EvaluateRulesVistor.visitXXNode(EvaluateRulesVistor.java:56)
at xxxx.xxx.xx.x.xx.XXNode.accept(XXNode.java:396)
at xxxx.xxx.xx.x.xx.AssetXX.traverseForest(AssetXX.java:351)
at xxxx.xxx.xx.x.xx.AssetXX.run(AssetXX.java:70)
at xxxx.xxx.xx.x.xx.XXEngine.doForecast(XXEngine.java:437)
at xxxx.xxx.xx.x.xx.XXEngine.forecastWorkOrders2(XXEngine.java:380)
I am interested in why this happens?Is it possible that my customer do something to the existing code(customization)?
e. printStackTrace() is generally discouraged because it just prints out the stack trace to standard error. Because of this you can't really control where this output goes. The better thing to do is to use a logging framework (logback, slf4j, java.
A trace of the method calls is called a stack trace. The stack trace listing provides a way to follow the call stack to the line number in the method where the exception occurs. The StackTrace property returns the frames of the call stack that originate at the location where the exception was thrown.
The code that does not display line numbers was compiled without debug information.
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