How do I restart the Google App Engine Java Server

2019-03-11 22:07发布

OK, maybe I'm dumb/blind, but in the docs it says "rebuild and restart the server." But I don't see a button to do this anywhere. Or from any contextual menu. And I can't find anything in their docs explaining how to do it. If I just try to start the app again, it gets angry because I already have App Engine running on the needed port.

Only solution I've found is to restart Eclipse... any other ideas? A screenshot of a button would help if possible. :)

7条回答
Juvenile、少年°
2楼-- · 2019-03-11 22:16

In eclipse, there is a view that contains your Console. If you click on that, you will see the STDOUT and STDERR output of your running application. In the upper right, there should be a red box that will terminate the currently running program.

alt t3xt

查看更多
ら.Afraid
3楼-- · 2019-03-11 22:16

If you include the gwt SDK in your project, the gwt development mode box contains a reload server button that will work just fine.

查看更多
Rolldiameter
4楼-- · 2019-03-11 22:19

The best I've found is to setup the keyboard shortcuts for the console's terminate button, and the run/debug start/restart command. By default, you can enable Command-F2 to terminate, and Command-F11 to restart, its fairly painless. Make sure to enable the full debug menu group (click on main toolbar -> customize, etc)

查看更多
女痞
5楼-- · 2019-03-11 22:23

I might add that the "little red box" is not always visible. It drove me crazy reading that same instruction but not seeing the terminate button until I discovered that the Console windows has "layers" that you can select from using the drop-down button on the far right of the controls for the Console view. You just need to go "back" to the console screen that says the server is running and you will see the little red terminate button.

查看更多
叛逆
6楼-- · 2019-03-11 22:24

I have a different and possibly more productive solution for you. Like with most web development environments you probably want to change your source code and have Google Appengine server reload the new code for you.

You need some version of the traditional "touch" unix command (if you work on windows you can download a version from here).

Then go to you project properties, Builders and add a new build step as a "Program". Under "Location" enter the path to your "touch" command ("D:\bin\UnxUtils\usr\local\wbin\touch.exe" for example - on Posix systems just "touch" should be enough since it's already in your PATH) and in "Arguments" put something like "${project_loc}/war/WEB-INF/appengine-web.xml". Also go to the "Build Options" tab and check "During auto builds".

"touch" will update the timestamp in you appengine-web.xml. When the App Engine server detects changes to you appengine-web.xml it will reload the app automatically. The load process is very fast so it can be done whenever you change any file in your project (which normally triggers the auto-build in Eclipse) - you can tweak the builder to only run when you change certain types of files.

查看更多
Luminary・发光体
7楼-- · 2019-03-11 22:32

The previous answer wasn't cutting the cheese for me. Upon first starting App Engine, the red square would be available above the text entry area. If I then clicked the run button again, then red square would go away and the console for the previous launch would be replaced by the console for the new launch. To manually stop the App Engine server, you can kill it from the terminal: http://geekbrigade.wordpress.com/2009/02/26/how-to-find-and-kill-a-process-that-is-using-a-particular-port-in-ubuntu/ In short, "sudo netstat -lpn |grep :8888" and kill the service by process ID.

Strangely, adding Google Web Toolkit to the project made my App Engine launch show up in the Development Mode pane, where it could be easily be killed or restarted.

查看更多
登录 后发表回答