While there are many resources specific to Java on reading a stacktrace, I don't think there are many related to ColdFusion or CFML. So let's make one

How to read a ColdFusion Stacktrace

submited by
Style Pass
2022-06-23 22:00:02

While there are many resources specific to Java on reading a stacktrace, I don't think there are many related to ColdFusion or CFML. So let's make one here.

The first line of the stacktrace will usually be formatted as type: message, the type is going to be the name of a java class that holds information about the exception, in this case it is lucee.runtime.exp.NativeException. In this case it is a Lucee server, but all the same ideas apply on a ColdFusion server. The message will hopefully give you a summary of what the actual problem is. Now I say hopefully, because this depends on how good the exception handling code is, we've all written a vague error message.

Next I work my way down the stacktrace starting at the top, looking for a cfm or cfc file. This tells me where in my code the exception originated from. If you can't find a cfm or cfc file, then it could be that the exception happened outside the context of your code (for example it could be thrown from Tomcat or ColdFusion or Lucee, etc before or after your code runs). In this example stacktrace we see a line:

That tells us it was the decrypt function call, but we can see that by looking at the line above this line in the stacktrace. That is useful because there are a few CFML functions being called on that line of code, trim, ucase and decrypt, but we know from the stracktrace that the exception happened in the decrypt call.

Leave a Comment