Yesterday, I got a ColdFusion error that I had never seen before:
java.lang.VerifyError (class: cftest212ecfm1626437113, method: runPage signature: ()Ljava/lang/Object;) Inconsistent stack height 1 != 0 null
That's certainly an error that sounds really bad. But, after some tag-context debugging, it came down to a silly commenting mistake. I had something like this:
<!--- Pick a random number. ---> <cfswitch expression="#RandRange( 1, 2 )#"> <cfcase value="1"> <cfset WriteOutput( 1 ) /> </cfcase> <cfcase value="2"> <cfset WriteOutput( 2 ) /> </cfcase> <cfdefaultcase> <cfswitch expression="#RandRange( 3, 4 )#"> <!--- I'll figure out these cases later. For now, just leave in the top-level switch. ---> </cfswitch> </cfdefaultcase> </cfswitch>
I had a CFSwitch statement inside of the CFDefaultCase of an outer CFSwitch statement. I had meant to comment out the nested CFSwitch statement, but accidentally, I commented out the nested CFCase statements only, leaving in the nested CFSwitch tag. My scenario was one of nesting, but if you have any ColdFusion CFSwitch tag that does not have any CFCase tags, you will get a similar error. For example, if I had a page that only had a CFSwitch statement, I get this error:
java.lang.VerifyError (class: cftest212ecfm1626437113, method: runPage signature: ()Ljava/lang/Object;) Inconsistent stack height 1 != 2
As you can see, this time it's (1 != 2) rather than (1 != 0), but other than that, it's the same error.
Want to use code from this post? Check out the license.