Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why some stacktrace do not have line number in java

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)?

like image 209
JaskeyLam Avatar asked Aug 07 '14 05:08

JaskeyLam


People also ask

Why we should not use e printStackTrace ()?

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.

What is exception StackTrace?

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.


1 Answers

The code that does not display line numbers was compiled without debug information.

like image 189
Mureinik Avatar answered Sep 19 '22 03:09

Mureinik