为什么一个长的cfc文件在CF8,但不是CF9工作?获得“分支目标偏移对于短”错误 [英] Why does a long cfc file work in CF8, but not CF9? Getting "Branch target offset too large for short" error

查看:739
本文介绍了为什么一个长的cfc文件在CF8,但不是CF9工作?获得“分支目标偏移对于短”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当长的cfc文件,大约1800行长,在ColdFusion 8中工作正常,但在我的开发系统升级到ColdFusion 9和做一些测试后,我得到一个编译错误的cfc和消息说分支目标偏移太大而短。我修改了文件以消除一些未使用的功能,并合并一个,使其更短,这解决了问题,让它工作。但是,当我升级到CF9时,为什么会死在我身上?任何人遇到这个问题在之前的或ColdFusion的当前版本?除了修改cfc文件之外,是否有其他任何解决方案,例如升级jvm?



EDIT
如果您有问题我有,伟大!发布,但不要浪费时间告诉我一些我已经知道的东西。如果您要发布回复,请仔细阅读问题,并回答,只有当您知道答案。不要做一个我已经知道和利用来获取代码工作的谷歌搜索和post crap。 问题是,为什么它在CF8中工作,现在不在CF9中?除了我做了之外,还有其他解决方案吗?

解决方案

这是JVM固有的问题, ,CF9可能为组件添加了更多的先天函数,如果这些方法都通过一个巨大的switch语句引用,并且short被用作偏移量,那么我们有更少的偏移指针空间来处理每个连续版本。从CF7到CF8的人也有同样的问题。



所以简短的答案是否定的。 $ b

你发现的大多数建议基本上告诉你把一个大的方法分成一个较小的方法和几个帮助方法。我第一次遇到一个问题,这对我有一个大的cfc。但是当它变大了没有帮助函数的数量可以解决它。最终,它必须拆分成多个cfcs。



PS:这个家伙说删除一个事务帮助(CF7),有没有包装我的电话,所以它不是一个可靠的修复我猜 http://www.coldfusionmuse.com/index.cfm/2007/9/28 /Branch.Target.Offset



编辑

看起来我的上一个问题是不同的功能太大,将CFC分成多个CFC是错误的。我已经把这个问题的方法分成更小的方法,并能够巩固所有的功能在一个CFC。所以这就是它的解决方案。


I have a fairly long cfc file, about 1800 lines long, that worked fine in ColdFusion 8, but after upgrading my development system to ColdFusion 9 and doing some testing I get a compile error for a cfc and the message says "Branch target offset too large for short". I modified the file to eliminate some unused functions and consolidated one to make it shorter and this resolved the problem to get it to work. But still, why did it die on me now when I upgraded to CF9? Anyone else run into this problem in previous or the current version of ColdFusion? Are there any solutions other than modifying the cfc file such as upgrading the jvm?

EDIT If you have an answer to the questions I have, great! Post that, but don't waste time telling me something that I already know. If you are going to post a response, please read the question carefully and answer only if you know the answer. Don't do a google search and post crap that I already know and utilized to get the code to work. The question is, why did it work in CF8 and now not in CF9? Are there other solutions besides what I did?

解决方案

This is a problem inherent with the JVM as you already know, CF9 has likely added more innate functions to a component and if the methods are all referenced via a giant switch statement with a short being used as the offset, we have less offset pointer space to work with each successive version. People moving from CF7 to CF8 also had the same problems.

So short answer is no.

Most recommendations you find basically tell you to split a large method into a smaller method and several helper methods. The first time I ran into an issue this worked for a large cfc I had. But then as it got bigger no number of helper functions would fix it. Eventually it had to be split into multiple cfcs.

PS: This guy said removing a transaction helped (CF7), there are none wrapping my calls though, so it's not a guaranteed fix I guess http://www.coldfusionmuse.com/index.cfm/2007/9/28/Branch.Target.Offset

Edit
Looks like my previous issue was a different function being too large, splitting the CFC into multiple CFCs was in error. I've since split that problem method into smaller methods, and have been able to consolidate all the functions in one CFC. So that is the solution it seems.

这篇关于为什么一个长的cfc文件在CF8,但不是CF9工作?获得“分支目标偏移对于短”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆