Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Branch target offset too large for short

614 views
Skip to first unread message

dougk

unread,
Nov 20, 2003, 8:41:57 AM11/20/03
to
We just encountered this error also. Have a CFC with a large amount of queries inside a cftransaction. If we remove the cftransaction call, things work fine. From the above sounds like some sort of CFC limit?????

anyone at MACR seeing this??? nothing is mentioned anywhere about it.

Cheers!

---
Douglas Knudsen
Alltel Communications, Inc.
Corporate Information Solutions

twillerror

unread,
Nov 20, 2003, 1:13:39 PM11/20/03
to
After some research into the error I discovered that this is a bug inside of the CF's java byte code compliler.

When they went to 6.1 they started writing the java class files out themselves using an open source library call bcel that you can find on http://jakarta.apache.org/bcel/

This short limit is actually part of java. We found that our error had to do with large numbers of concatnations. We where building a lengthly string. We ended up using mutliple variables and appending them together at the end to get it to work.

The error has to do with some internal java limitations on branching instructions. The guys at Macromedia really need to look into it. I wish I still had the exact line of code in bcel, but luckily the error only flies in one part of the class generator library.

On a side note and as a DBA I think cftransaction is evil. Look into using a stored procedure if you use SQL server or Oracle. If you use MySQL that doesn't support transactions you might try breaking the transaction down a bit if at all possible. Otherwise Macromedia will have to look at your particular template and see if they actually figure out this bug. Do us all a favor if you have the time and the support contract :)


et

Referring URLs
http://jakarta.apache.org/bcel/


Shaun

unread,
Nov 21, 2003, 4:38:58 AM11/21/03
to
Thanks for the replies.

I dont feel so alone now. My files work fine in CF 5 and I dont remember any issues with CF6.0 so I'm fairly sure this was introduced in 6.1.

I am also concatenating a lengthy string so at least I know if push comes to shove I can provide a workaround using multiple variables and appending them together ( although this could take a fair bit of time from a budget we dont have ). Hopefully macromedia will provide a fix though...

Regards,
Shaun.

Heres my stack trace for the error if it helps anyone:

org.apache.bcel.generic.ClassGenException: Branch target offset too large for short
at org.apache.bcel.generic.BranchInstruction.dump(BranchInstruction.java:99)
at org.apache.bcel.generic.InstructionList.getByteCode(InstructionList.java:980)
at org.apache.bcel.generic.MethodGen.getMethod(MethodGen.java:587)
at coldfusion.bytecode.JavaAssembler.getBytes(JavaAssembler.java:367)
at coldfusion.compiler.TemplateAssembler.assemble(TemplateAssembler.java:69)
at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:265)
at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:97)
at coldfusion.runtime.TemplateClassLoader$1.fetch(TemplateClassLoader.java:263)
at coldfusion.util.LruCache.get(LruCache.java:188)
at coldfusion.runtime.TemplateClassLoader$TemplateCache.fetchSerial(TemplateClassLoader.java:214)
at coldfusion.util.AbstractCache.fetch(AbstractCache.java:58)
at coldfusion.util.SoftCache.get(SoftCache.java:81)
at coldfusion.runtime.TemplateClassLoader.findClass(TemplateClassLoader.java:356)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:73)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:47)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:35)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:43)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:105)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:192)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


CFFLDave

unread,
Nov 28, 2003, 11:56:08 AM11/28/03
to

Here is my take on this. I have both very large concatenated strings, and am using a very large transaction block with lots of <cftry><cfcatch> blocks. I have found that when I commented out <cftry><cfcatch> block code, one by one, I got it to succeed. I then uncommented out a randon <cftry><cfcatch> block, unrelated to string concatenation, and it failed. Therefore, I feel this error is releated to the number of <cftry><cfcatch> blocks in a large <cftransaction>, not string concatenation.

David Dumas
Infospot Inc
303.902.9384

dougk

unread,
Dec 1, 2003, 9:18:49 AM12/1/03
to
In our case we had no large string concats going one. Nor did we have any try/catch blocks. We only had one cftransaction block with a large amount of cfqueries inside. All this in one cfc, not good practise really anyhoo.

Shaun

unread,
Feb 12, 2004, 9:47:32 AM2/12/04
to
In case it helps anyone I resoved the issue by breaking the file into smaller
files and calling them using cfinclude.

This worked fine so it seems there is a file size limitation.

Regards
Shaun.

yoosaf...@gmail.com

unread,
Apr 8, 2014, 9:22:13 AM4/8/14
to
Hi,

pls check my post here: http://stackoverflow.com/a/22938385/676508
0 new messages