Author: Steven Neiland

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

Problems with Fusebox 4+

At this stage you should be able to deploy your compiled code and enjoy the benefits of precompiled cfml...that is unless you happen to use the fusebox framework (specifically the xml based versions 4 and above).

The problem is that fusebox4+ uses xml config files. In of itself this is not a problem except that it is necessary to hide these files from being directly visible. Fusebox accomplishes this by appending the cfm extension to the xml config files. Thus a circuit xml file is actually named circuit xml.cfm . This results in the cfcompiler trying to translate the xml files into java bytecode. While the compiler succeeds Fusebox is unable to read and utilise the resulting gibberish.

The Batch File Solution

Fortunately the solution is a little piece of batch file magic. First create a txt file and paste the following code.

@echo off
echo Please input source folder path (DO NOT QUOTE PATH)
echo Wrong: "C:\DIR\FILES\"
echo Correct: C:\DIR\FILES
set /p source=Source Directory:
echo Please input destination folder path
set /p dest=Destination Directory:

:: /s tells xcopy to also do subfolders
:: /y turns off overwrite prompt
xcopy /s /y "%source%\*.appinit.cfm" %dest%
xcopy /s /y "%source%\*.init.cfm" %dest%
xcopy /s /y "%source%\* xml.cfm" %dest%

echo Files successfully copied!

Now convert the txt file to a batch file by changing its extension from.txt to .bat. Name this file as "fuseboxCompileFix.bat". After creating our java bytecode we can run fuseboxCompileFIx from the command prompt to go back to our source code directory and recopy the xml config files to overwrite the bytecode gibberish in the compiled directory.

All this code does is ask for the source code directory, the destination (ie compiled code) directory and recursively overwrite any of the three types of config file with the source code original.

1 2 3

What Do You Think?

Reader Comments

Post a Comment

Comment Etiquette:

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain or appear to be advertisments, will not be published.
  • Comments that appear to be created for the purpose of linkbuilding to commercial sites will be removed.

We are all adults here so play nice.


Archives Blog Listing

Tag Listing

Learn CF In A Week


Fork me on GitHub