How to configure your default cfengine on commandbox

Author: Steven Neiland
Published:

I've been doing react development for the last year which has kept me away from cf and cf related tools. Needless to say I'm a bit rusty which was highlighted last week when I went to configure commandbox and testbox for a new side project and almost immediately ran into problems.

Lucee was not able to load a Agent dynamically! You need to load one manually by adding the following to your JVM arguments [-javaagent:"/home/sneiland/.CommandBox/server/2D6DCF4952D4071DCB5C19728539514A-cf/lucee-5.2.9.31/WEB-INF/lucee-server/context/lucee-external-agent.jar"

After a quick query out to the box-products channel on slack Brad Wood was able to diagnose that there was an issue with the version of java I was running "openjdk11" and that particular version of lucee 5.2.9. All I had to do was simply run the 5.3 version of lucee instead. Simple right, except my brain had decided to drop all information about how to configure commandbox by this time. Fortunately Brad being the gentleman he is, he walked me through the config. So for future reference:

Running a Specific Version of an Engine

If you want to run a specific engine and version on commandbox all you need to do is append the attribute cfengine={enginename}@{version} to your box start command. ie.

box start cfengine=lucee@5.3.5

This will update your server.json file with that engine and version. The next time you run "box start" it should just remember that selection so you don't need to specify the version each time.

Configure a global default engine

Now maybe it is the case that you want to configure a global default engine as opposed to a application specific default. This can be handy where you are working with multiple repositories and may not be permitted (for "reasons") to update/add an app engine default in a projects server.json file. Fortunately commandbox allows for this also.

box config set server.defaults.app.cfengine=lucee@5.3.5

Hopefully now I've written that down I wont have to go bothering Brad again....about this anyway :)

What Do You Think?

Reader Comments

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.
*
*



Archives Blog Listing