Why does CF8 have a long cfc file, but not CF9? Getting the error "Branch response offset is too large for short"

I have a rather long cfc file with a length of about 1800 lines, which worked fine in ColdFusion 8, but after upgrading my development system to ColdFusion 9 and doing some testing, I get a compilation error for cfc, and the message says: "The target offset branch is too large for brevity. " I modified the file to eliminate some unused functions and simplified them to reduce it, and this solved the problem to make it work. But still, why did he die on me now when I switched to CF9? Does anyone else encounter this issue in a previous or current version of ColdFusion? Are there any solutions besides modifying the cfc file, such as updating jvm?

EDIT If you have an answer to my questions, great! Post it, but don’t waste your time telling me what I already know. If you intend to post an answer, carefully read the question and answer only if you know the answer. Don't do google searches and shit that I already know and use to get the code to work. The question is, why did he work in CF8 and now not in CF9? Are there other solutions besides what I did?

0
coldfusion cfc
source share
3 answers

This is a problem inherent in the JVM, as you already know, CF9 most likely added more innate functions to the component, and if all methods refer to a giant switch statement with a short use as an offset, we have less pointer space offset for working with each sequence version. People moving from CF7 to CF8 also faced the same problems.

So the short answer is no.

Most of the recommendations that you will find mostly tell you to split a large method into a smaller method and some helper methods. The first time I ran into a problem, it worked for the big cfc that I had. But then, when it became larger, the number of auxiliary functions would not eliminate it. In the end, it had to be split into several cfcs.

PS: This guy said deleting the transaction helped (CF7), there are no windings of my calls, so this is not a guaranteed fix. I suppose http://www.coldfusionmuse.com/index.cfm/2007/9/28/Branch.Target.Offset

Edit
It seems that my previous question was too big a function, and splitting the CFC into several CFCs was wrong. Since then, I have divided this problem method into smaller methods and have been able to consolidate all the functions in one CFC. So this solution seems to be.

+4
source share

If you have not already done so, try starting the code analyzer on the CFAdmin page, "Debugging and Logging> Code Analyzer." This is a useful tool for finding changes that have been made in the language between CF8 and CF9.

We had to change several variable names and function names since CF added them to 9.

Also check here:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ff0.html

+2
source share

CF Version: 10 OS: Linux CentOS 6.0

Lee ran into a similar problem when I had 1300 lines of code in my cfc, and one fine day I got a "Branch Departure" error. I tried

  • A code analyzer to find any legacy loopholes - DID NOT FIX

  • Edited cfc to trim any last bit of redundant code or comments - reduced by 20+ lines of code - DID NOT FIX

  • I split the code into 2 cfc and extended one to the other - DID NOT FIX

  • I removed any unwanted dump of requests and arrays (part of testing): THIS WORKS

therefore, I would suggest that you do not have dumps of large amounts of data. Hope this helps.

+1
source share

All Articles