Good to know. That explains why I haven't run into it as I tend to nest fuses (I don't actually use Fusebox but something akin to it). I try to keep individual switch statements to between 5 and 10 case statements with no more than 20. Gets to hard to read otherwise.
Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 -----Original Message----- From: Rob Rohan [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 5:45 PM To: CF-Talk Subject: RE: Switching to CFMX Thanks Benjamin, I appreciate your response, and I'll check out the xml file - that's a great tip. You will run into this when doing large files or working on a large application http://webforums.macromedia.com/coldfusion/messageview.cfm?catid=3&threa did= 385775 The index file I am dealing with is > 2500 with a huge case statement that includes / module calls a lot of files. here is the problem: when you write <cftag> <cfswitch> <cfcase>balrg</cfcase> </cfswitch> ... </cftag> that gets created into public class whatever{ => public whatever(){ switch(barg){ case blarg: } ... => } } The parts marked between => can be no greater than 64k. One has no way of knowing how large that is when writing a cfm page because the instruction swapping is hidden from the programmer. It seems to happen at about 1500 or so lines. The 64k limit is a Java limitation. The *only* work around I found is to break the large file into smaller files (in my case index0.cfm, index1.cfm, index2.cfm, etc), and have a master index with a fuse action list that include the proper index file. <cfswitch switch="attributes.fuseaction"> <cfcase value="listall,showone,dosomething,doanotherthing" delimiters=","> <cfinclude template="index0.cfm"> </cfcase> <cfcase value="update,delete,dothis,dothat" delimiters=","> <cfinclude template="index1.cfm"> </cfcase> ... </cfswitch> It adds a whole layer of abstraction, but seems to work. Again this only happen when doing really large files and the (evil) errors MX gives are the following (for the next poor sap searching the archives): (class: cfindex12ecfm1447028664, method: _factor1 signature: (Ljavax/servlet/jsp/tagext/Tag;)Ljava/lang/Object;) Illegal target of jump or branch ColdFusion cannot determine the line of the template that caused this error. This is often caused by an error in the exception handling subsystem. OR Code of a method longer than 65535 bytes Thanks again Rob -----Original Message----- From: Benjamin S. Rogers [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 2:12 PM To: CF-Talk Subject: RE: Switching to CFMX > * Does cfinclude copy the contents of every included file > then compile - regardless of the switch statement? I believe includes still happen dynamically. You can verify this by deleting all the files in the following directory: \CFusionMX\wwwroot\WEB-INF\cfclasses Restart the ColdFusion service and make a request to your page. It should only create class files for the files that were needed to complete the request. BTW, I just checked and my developer version behaves this way. > * Does the compiled cfm make a whole class, is it only a > method in some master class, or is everything stuck into a > single method? is there a way to force other methods, like > how cfcase only runs the necessary code? It appears that each ColdFusion page (*.cfm), ColdFusion component (*.cfc) and function gets its own class file. For a look at what's going on behind the scenes, edit the web.xml file in the following directory: \CFusionMX\wwwroot\WEB-INF\ Change the "coldfusion.compiler.saveJava" parameter to "true." This will create .java source files for each of the classes. You may be able to get a better idea of what is going on from there. Again, you'll probably have to restart the ColdFusion service. > This seems like a serious problem with CFMX for a large > application using fusebox so I hope someone has experienced > this and has a elegant workaround. I haven't run into any problems specific to porting Fusebox style applications to ColdFusion MX, except the fact that the first request is always interminably slow. I don't have any in production, However. I've only ported several such applications to a Developer Version of ColdFusion MX for testing purposes. Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists