25

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. :)

bpapa
  • 21,409
  • 25
  • 99
  • 147

7 Answers7

26

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

hyperslug
  • 3,473
  • 1
  • 28
  • 29
Kai
  • 3,997
  • 4
  • 30
  • 36
  • 3
    Unfortunately this is a terrible answer - the workflow for restart is "click on the console tab to bring that forward, remove the other consoles that have popped up over the GAE console, click the red button, then click start up in the toolbar". It's hard to describe how frustrating this ritual is, repeated hundreds of times in a day. Fortunately the "touch appengine-web.xml" answer works! – stickfigure Mar 02 '12 at 17:10
  • This is the answer even though the steps aren't very detailed. If you need more specific steps, I found them at the following site http://www.hoverdroids.com/errors/google-app-engine/stop-or-restart-a-previously-started-google-app-engine-local-server-in-eclipse/ – Chris Sprague Feb 03 '16 at 21:38
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.

miguelv
  • 2,856
  • 1
  • 25
  • 24
  • It's the best intellectual and effective solution here. – gaRex Jan 01 '12 at 22:29
  • You just saved me about fifteen cumulative minutes of pointless clicking throughout every single workday. THANK YOU!! – stickfigure Mar 02 '12 at 17:12
  • Looks like I spoke too soon. Reloading the server this way causes appstats to throw ClassCastExceptions. Sigh. I've filed this bug: http://code.google.com/p/googleappengine/issues/detail?id=7052 – stickfigure Mar 02 '12 at 17:51
  • 2
    Instead of touch, you can use this trick. http://stackoverflow.com/questions/51435/windows-version-of-the-unix-touch-command#923927 – Palani Jun 29 '12 at 13:00
  • I thought that `touch` main purpose was to create new files! I have learnt two tricks from this answer. – Hakim Jul 24 '13 at 21:36
11

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.

4

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.

dmiller309
  • 385
  • 5
  • 8
3

Just Click on Debug perspective (should be on upper right panel), select the instance of web application on Debug panel (if you don't show it, you could enable by menu Window->show view->Debug) and click on red box of view menu.

0

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

Ajax
  • 2,465
  • 23
  • 20
  • could you show a printscreen please, I can't locate that 'gwt dev box'? thanks, *edit nvm I'm on win7 unlike you probably* –  Nov 30 '13 at 02:08
  • Window -> Show View -> Other -> Type "Dev" into box; select "Google -> Development Mode". This will require you to enable GWT in the Google section of your project settings (click project -> alt + enter -> type "Web Toolkit" in filter box -> click "Enable Google Web Toolkit"). When both GWT and appengine are enabled, the development mode server allows you to restart both at once by using the reload icon in dev mode gui. – Ajax Dec 01 '13 at 19:41
0

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)

chrismarx
  • 11,488
  • 9
  • 84
  • 97