Command Line execution of a project

4
Is there a simple way of executing the Mendix Business Server and a specific project from a command line/script? I tried capturing the command/argumnets from the eclipse run configuration but doesn't seem to work?
asked
2 answers
5

Short answer: No there isn't a 'simple' way of doing this.

Long answer: No, there isn't a 'simple' way of doing this, unless your simple script partially or fully implements the external 'M2EE API', that is used to communicate with a Mendix Business Server after initial startup.

After a bare minimum process is started, this API is used to control the process lifecycle. This enables a very flexible model of controlling an application in very different settings. The API is implemented by e.g. the Mendix Modeler, the separate little version of the admin console when using Eclipse, the Mendix Cloud Portal, the m2ee-tools scripts (for custom cloud or on premise linux hosting) and the Mendix Service Console for on-premise windows deployments. The API contains functions like setting loglevels, sending configuration for database access, microflow constants, scheduled events, and functionality to query the mendix application server process about what it's doing, monitoring statistics, profiler/debugger utilities, etc.

When you start the application from eclipse, you might have noticed there's a default kind of way a java program gets started (a classpath, a main class...) and some environment variables to bootstrap the process (e.g. an extra tcp port and password besides the normal tcp port you can point your webserver to for handling /xas/). Using these options, the JVM process starts. After that, another utility (modeler, cloud portal etc...) takes control to do what's needed to get the application fully running.

If you're using a gnu/linux-like system with a jvm and python, you can use the m2ee-tools locally to quickly start and stop applications from the command line, pointing your configuration file to a deployment-location of a project (that's when I do when developing them).

If you're a windows guy, you could file a feature request for a scriptable sort of admin console, or ask for an SDK-like something that would be as easy as publishing the service console source code somewhere so you can build it yourself using .NET stuff.

Or I could just ask the question: "Why would you want to start the server from the command line instead of one of the provided other ways?" :-)

answered
0

We need the invocation for this for windows to handle crashes

Investigation so far has revealed it will be something like this:

 

...
set MX_INSTALL_DIR="c:\Program Files\Mendix\7.16.0"
set M2EE_ADMIN_PORT=8071
set M2EE_RUNTIME_PORT=8071
java -jar "c:\Program Files\Mendix\7.16.0\runtime\launcher\runtimelauncher.jar" "C:\Users\me\Documents\Mendix\ProjName\deployment"

Please advise

answered