In Python's jpype, calling System.exit will also shut down the Python environment. Also, calling system.exit in a web container will shut down the container. I've added a switch to disable the call to System.exit in AppManager to avoid this in Python. (Note that you should never have to explicitly call System.exit, and I should remind myself why this is needed in Autoplot.)
The web container, which can run whitelisted scripts, still has the problem that if System.exit is called the web container is shut down. A more complete solution would add a hook to the shutdown sequence.
See https://github.com/jpype-project/jpype/issues/961, the ticket in JPype where someone wants to change the shutdown behavior.
This is done, see AppManager.getInstance().setAllowExit(false).