Exception while creating coldbox resource

Hi all

I’m trying to create a resource with the coldbox resource command. There are Files created but it seems to fail to add the routing to the Router.cfc file.

I’ve got the follwing exception.

CommandBox:api> coldbox create resource resource="Charts" api="true" open="false" force=true
 INFO   Generating (Charts) resources...
 INFO   --> Generated (Charts) Handler: [C:\inetpub\wwwroot\wog-v3\api\handlers\/Charts.cfc]
 INFO   --> Generating integration tests...
 INFO   Created Test [C:\inetpub\wwwroot\wog-v3\api\tests\specs\integration\/ChartsTest.cfc]
 INFO   --> Generating resource model (Chart)
 INFO   Created Model: [C:\inetpub\wwwroot\wog-v3\api\models\/Chart.cfc]
 INFO   Created Test: [C:\inetpub\wwwroot\wog-v3\api\tests\specs\unit\/ChartTest.cfc]
 INFO   --> Generating resource service (ChartsService)
 INFO   Generated Method: save()
 INFO   Generated Method: delete()
 INFO   Generated Method: list()
 INFO   Generated Method: get()
 INFO   Created Model: [C:\inetpub\wwwroot\wog-v3\api\models\/ChartsService.cfc]
 INFO   Generated Test Method: save()
 INFO   Generated Test Method: delete()
 INFO   Generated Test Method: list()
 INFO   Generated Test Method: get()
 INFO   Created Test: [C:\inetpub\wwwroot\wog-v3\api\tests\specs\unit\/ChartsServiceTest.cfc]

ERROR (5.9.1+00767)

Component [commandbox.modules.coldbox-cli.commands.coldbox.create.resource] has no accessible Member with name [BREAK]

C:\Users\KevinSchaefer.SPACE\.CommandBox\cfml\modules\coldbox-cli\commands\coldbox\create\resource.cfc: line 305
303:                    var routerContent = fileRead( routerPath ).replaceNoCase(
304:                            "// @app_routes@",
305:                            routerCode & variables.break
306:                    );
307:                    fileWrite( routerPath, routerContent );
called from C:\Users\KevinSchaefer.SPACE\.CommandBox\cfml\system\services\CommandService.cfc: line 443
called from C:\Users\KevinSchaefer.SPACE\.CommandBox\cfml\system\services\CommandService.cfc: line 225
called from C:\Users\KevinSchaefer.SPACE\.CommandBox\cfml\system\Shell.cfc: line 865
called from C:\Users\KevinSchaefer.SPACE\.CommandBox\cfml\system\Shell.cfc: line 680
called from C:\Users\KevinSchaefer.SPACE\.CommandBox\cfml\system\Bootstrap.cfm: line 165
lucee.runtime.exp.ExpressionException: Component [commandbox.modules.coldbox-cli.commands.coldbox.create.resource] has no accessible Member with name [BREAK]
        at lucee.runtime.ComponentScopeShadow.get(ComponentScopeShadow.java:130)
        at modules.coldbox_cli360.commands.coldbox.create.resource_cfc$cf.udfCall(/commandbox/modules/coldbox-cli/commands/coldbox/create/resource.cfc:305)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:699)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
        at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1952)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1794)
        at system.services.commandservice_cfc$cf.udfCall1(/commandbox/system/services/CommandService.cfc:443)
        at system.services.commandservice_cfc$cf.udfCall(/commandbox/system/services/CommandService.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
        at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:804)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1794)
        at system.services.commandservice_cfc$cf.udfCall1(/commandbox/system/services/CommandService.cfc:225)
        at system.services.commandservice_cfc$cf.udfCall(/commandbox/system/services/CommandService.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
        at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:698)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
        at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1933)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1775)
        at system.shell_cfc$cf.udfCall4(/commandbox/system/Shell.cfc:865)
        at system.shell_cfc$cf.udfCall(/commandbox/system/Shell.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
        at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:804)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1794)
        at system.shell_cfc$cf.udfCall3(/commandbox/system/Shell.cfc:680)
        at system.shell_cfc$cf.udfCall(/commandbox/system/Shell.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:699)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
        at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1952)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1794)
        at users.kevinschaefer_space644._commandbox46.cfml.system.bootstrap_cfm$cf.call(/Users/KevinSchaefer.SPACE/.CommandBox/cfml/system/Bootstrap.cfm:165)
        at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1056)
        at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:948)
        at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:929)
        at 13mz9x80pdcg1.call(Unknown Source)
        at lucee.runtime.compiler.Renderer.tag(Renderer.java:107)
        at lucee.runtime.compiler.Renderer.script(Renderer.java:97)
        at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:65)
        at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:220)
        at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:331)
        at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:157)
        at cliloader.LoaderCLIMain.main(LoaderCLIMain.java:583)

Do you have any idea why this is happening? I’m using the coldbox cli 7.2.1
I created my project from the rest template.

Thank you in advance for your help.

Out of my curiosity, I tried the command. It generated the code as intended.
CommandBox v5.9.1+00767

Interesting, thanks for checking. I even created a new app from scratch and running in the same error.

coldbox create app name=test skeleton=rest
coldbox create resource resource="Charts" api="true" open="false" force=true

Results in the error Component [commandbox.modules.coldbox-cli.commands.coldbox.create.resource] has no accessible Member with name [BREAK] again.

Commadbox: v5.9.1+00767
ColdBox CLI Version: 7.2.1+7