When I was attempting to create my app using commandBox I ran into an issue when i used the “box coldbox create app myApp” command. It it throwing the following error:
Exception in thread “main” java.io.FileNotFoundException: /Users/danielroemer/Sites/lol/coldbox (Is a directory)
at java.io.FileInputStream.open(Native Method)
I attempted to troubleshoot but was unable to resolve the issue. I was in the proper director when I ran the command. The “box install coldbox-be” command worked perfectly that I ran prior.
Any help would be greatly appreciated!
Thanks in advance!
Dan, does the command run if you execute it from the interactive shell?
ComandBox > coldbox create app myApp
ColdBox Platform Evangelist
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Yes that worked for me. Looks like it was just an issue when I’m not in the interactive shell.
I think I know what the issue is. There are some checks when the Java wrapper on CommandBox starts up to try and “detect” if the first part of what you typed is an actual file. If so, it tries to run that file as a .cfm file.
Example, you can execute .cfm file like so:
box execute foo.cfm
To make that simpler like other CLIs we also allow you to just type this:
The code linked below basically tests the first parameter “foo.cfm” and sees if it is a java.io.File that exists() and if so it tries to execute it directly instead of parsing the parameters as a command.
The problem is that java.io.File can also represent directories. (It really should have just been called “Path” in my opinion). Since you already installed Coldbox, the “coldbox” part of “coldbox create app myApp” is being matched as a “File” and the shell is trying to load and execute it.
The fix is we need to ALSO check .isFile() on it.
As a short term workaround, you can not install ColdBox first and use the --installColdBox flag on the “coldbox create app” command, Or just run the “coldbox create app” and “install coldbox” commands in the opposite order.