When I try to restart my box server, I get the error below. My server stays running and I don’t think it ever shuts down. Currently I stop/start to handle this, but this changes my port (I need to see if I can use one particular port).
Trying to stop server…
server stop ‘crud’
Stopping crud…
lucee.commons.cli.CommandException: Could not stop server. Are you sure it is running, and listing for stop requests on port 58389?
at lucee.commons.cli.Command.execute(Command.java:69)
at lucee.runtime.tag._Execute._run(_Execute.java:81)
at lucee.runtime.tag._Execute.run(_Execute.java:72)
ERROR
Error invoking external processCould not stop server. Are you sure it is running, and listing for stop requests on port 58389?
Trying to start server…
server start name=‘crud’ port=58388 openBrowser=false --!saveSettings
The server for /Users/raymondcamden/OneDrive/WorkProjects/md/crud is starting on 127.0.0.1:58388… type ‘server status’ to see result
lucee.commons.cli.CommandException: objc[22086]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/bin/java (0x10af9e4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10b0e84e0). One of the two will be used. Which one is undefined.
No, it is server.json. I've not "named" this server. How do I do that?
box server name X didn't work. Can I just literally rename server.json
to server-X.json?
Ok.... so I renamed server.json to server-mdcrud.json.
Now I can
box server start name=mdcrud
and
box server restart name=mdcrud
I wish I could specify a default name for the current directory so I
didn't have to add name=X, but restart works now. Of course, I have to
re-add my DSN. I need to add that to my App.cfc.
You don’t have to use the name argument if you are only going to be starting/stopping one server. The command generated for the server start in the restart command (earlier in the thread) was
server start name='crud' […etc]
which is being called because the server name argument is passed in your restart command:
server restart 'crud'
This “names” the server and will automatically look for a file named server-crud.json, which will be the core config for that server. From that point on, the name argument will have to be passed to all of the sever commands for that server, or it will use the default (creating it, if it doesn’t exist).
Omitting the name argument will default to using the default server.json file.
Unless you’re doing multi-engine work/tests, you likely only ever need a single server.json file. If there is a name key in your core server.json, then remove it and just use server start, server restart, etc.
If you want to use a specific engine with your default server, you can just configure it in the base server.json file:
I'm not quite sure I understand what you are saying. In every case
when I left off name, box wasn't able to restart. I can say I've got
multiple servers with the name 'crud' in my core servers.json, and
maybe box was confused?
That’s probably exactly what’s happening. There can be only one server config per server.json file.
There was a beta version of 3.0 that used a single config file, but that created all sorts of problems and was dropped in favor of multiple server config files.
If you have named servers in the default server.json file, that may be at issue as well.
I think I'll leave stuff alone for now and just deal w/ the name=x. As
it stands, I probably won't be stopping very often, just restarting to
get rewrite rules updated.