EasyCFM.COM ColdFusion Forums / Coding Help! / Branch target offset too large for short

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Branch target offset too large for short

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Lossed
09-19-2007 @ 12:16 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1095
Joined: Apr 2004

This is a CFC.

Top few inches of stack trace:

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:616)
     at coldfusion.bytecode.JavaAssembler.getBytes(JavaAssembler.java:371)


Is it my CFC is too large to compile to a short data type? Or something else?

What is the best way around this? Do I just have an include folder in the CFC folder and include chunks of code into the CFC's function/method, or is there no other solution than reducing the size of the CFC?
Maybe the original method can call another CFC's methods, so I can daisy-chain along?



Lossed
---------------------------
When the only tool you have is a hammer, everything looks like a nail Smile
-----------------------------

megan
09-19-2007 @ 8:08 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

Hi Lossed - I've been monkeying with cfcs lately and apparently this error comes up if the cfc is too large, has a lot of repetitive code etc.  You can use cfinclude in a cfc, also you might want to tale a look at Growly Bears OOP cfc demo cfpaperclip (CF & OOP Made Easy http://www.cfpaperclip.com/ for an oop way of tying together separate smaller cfcs to see if that will help.

hth, Megan

We have art so that we shall not die of reality ~ Nietzsche

Lossed
09-19-2007 @ 5:10 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1095
Joined: Apr 2004

Thanks Megan...and Growly.
It's starting to sink in, slowly.
One word that keeps springing to mind is 'granular'.

Lossed
---------------------------
When the only tool you have is a hammer, everything looks like a nail Smile
-----------------------------

Lossed
09-19-2007 @ 11:34 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1095
Joined: Apr 2004

A little off topic here but...I was reading this CFC tips page and the part about scopes:
"Variables in the variables scope that are set within the calling page are not automatically available within the component's variables scope.".

I wonder what conditions need to be satisfied for the calling page variables-scoped vars to not be available to (or not clash with variables-scoped vars in) the CFC?

This coincides with an issue Rob helped me out with a few days ago where I was wondering how to avoid var/query name conflicts.
That quoted sentence above introduces a grey area into my understanding of the variables scope within CFC's and on calling pages. Can anyone help turn the grey into black and white please?

TIA.

Lossed
---------------------------
When the only tool you have is a hammer, everything looks like a nail Smile
-----------------------------


Website Designed and Developed by Pablo Varando.