Deploying the Application

In this final part of the Guestbook tutorial, you learn how to deploy your application, including generating the Cloud Datastore indexes required for deployment.

This page is part of a multi-page tutorial. To start from the beginning and see instructions for setting up, go to Creating a Guestbook.

Generating indexes

When you test and exercise your app on the development server, the development server automatically creates any Cloud Datastore indexes required to run in production. These indexes are generated in guestbook/target/guestbook-1.0-SNAPSHOT/WEB-INF/appengine-generated/datastore-indexes-auto.xml and are automatically uploaded when you deploy your app.

To generate indexes so you can deploy your app:

  1. Using the development server, exercise all of the queries supported by the app.

  2. Open the file guestbook/target/guestbook-1.0-SNAPSHOT/WEB-INF/appengine-generated/datastore-indexes-auto.xml in an editor and make sure that it contains the following:

    <datastore-indexes autoGenerate="true">
      <datastore-index kind="Greeting" ancestor="true" source="manual">
          <property name="date" direction="desc"/>

    Typically, you have to change source="auto" to source="manual".

For complete information about indexes, see Datastore Indexes.

Deploying your app

To deploy your app to App Engine:

  1. Change to the appengine-java-guestbook-multiphase-master/final directory, and invoke Maven:

    mvn appengine:update

    The first time you upload, you are prompted to supply login information and are led through the login process in the browser. Follow the prompts. You might need to copy the success code from the browser into the command line at the end of the login process. This information is retained so you don't need to repeat this process.

  2. Wait for the upload to complete. When the upload succeeds, you see a message similar to this one:

    98% Uploading index definitions.
    Update for module default completed successfully.
    Cleaning up temporary files for module default...
  3. To run the application, browse to the following URL:


    Replace [PROJECT-ID] with your project ID.

Troubleshooting deployment failures

Your update attempt might fail with a message similar to this one:

404 Not Found This application does not exist (app_id=u'your-app-ID').

This error will occur if you have multiple Google accounts and are using the wrong account to perform the update.

To solve this issue:

  1. Change directories to ~.

  2. Locate a file named .appcfg_oauth2_tokens_java, and rename it.

  3. Try updating again. You will be prompted to authorize the upload again.

That's it! You have completed this code walkthrough.

What's next

You might want to check out the following features:

For a deeper dive into how App Engine works, see the documentation on the Java Runtime Environment, and request handling and routing.

Send feedback about...

App Engine standard environment for Java