Google App Engine – Google Plug-in for Eclipse


Download Eclipse IDE for Java EE Developers from http://www.eclipse.org/downloads/

Install Google Plug-in for Eclipse and follow instructions given at: http://code.google.com/eclipse/docs/install-eclipse-3.6.html

 Google Plug-in for Eclipse
Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers
GAE Plugin Installation in Eclipse
GAE Plugin Installation in Eclipse

Figure 1 – GAE Plugin Installation in Eclipse

Next -> Review Items to be installed

Next -> Review Licenses – Select the radio button – I accept the terms of License Agreement – Click Finish

It will take some time to install GAE environment in your local system.

Click New-> Select Google -> Select Web Application Project

Google Web Application Project
Google Web Application Project

Figure 2 – Google Web Application Project

Deselect Google Web Toolkit from Google SDKs Section

 Google SDK settings for Web Application Figure 3 – Google SDK settings for Web Application

Click Finish Web Application Structure for GAE

Figure 4 – Web Application Structure for GAE

It is a normal web application structure and the only difference is appengine-web.xml

Table 1 – appengine-web.xml Structure

<?xml version=“1.0” encoding=“utf-8”?><appengine-web-app xmlns=http://appengine.google.com/ns/1.0&#8221;><application></application><version>1</version><!–

Allows App Engine to send multiple requests to one instance in parallel:

–>

<threadsafe>true</threadsafe>

 

<!– Configure java.util.logging –>

<system-properties>

<property name=“java.util.logging.config.file” value=“WEB-INF/logging.properties”/>

</system-properties>

 

<!–

HTTP Sessions are disabled by default. To enable HTTP sessions specify:

 

<sessions-enabled>true</sessions-enabled>

 

It’s possible to reduce request latency by configuring your application to

asynchronously write HTTP session data to the datastore:

 

<async-session-persistence enabled=”true” />

 

With this feature enabled, there is a very small chance your app will see

stale session data. For details, see

http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions

–>

 

</appengine-web-app>

 

 

Now just open http://localhost:8888 in browser

Local Environment of GAE

Figure 5- Local Environment of GAE

Click on GAETest to run it in local environment

Execution of GAE Application in Local Environment

Figure 6 – Execution of GAE Application in Local Environment

Deploy Sample Hello, Open Source For You web application on GAE

 Deploy Application to GAE from Eclipse

Figure 7 – Deploy Application to GAE from Eclipse

To deploy it on GAE, Authentication is required.

Provide username and Password in a new window.

Accept the terms of service and privacy policies.

If Application ID is not set then Deployment process will give error: “GAETest does not have an application ID”

To create an application Id -> Open https://appengine.google.com Login and Create New Application ID

Create Application Identifier for GAE Application

Figure 8 – Create Application Identifier for GAE Application

Click on Create Application. It will give message “Application Registered Successfully” if all goes well.

To proceed further, Click on the project settings link in the same dialog box.

Provide Application Identifier in Eclipse Properties

Figure 9 – Provide Application Identifier in Eclipse Properties

Click ok and Application ID error will be solved. Now Click on Deploy.

Deploy Project to GAE

Figure 10 – Deploy Project to GAE

Once the deployment Process will complete, Console output will be like:

Table 2 – Deployment Output from Eclipse

———— Deploying frontend ————

 

Preparing to deploy:

Created staging directory at: ‘C:UsersadminAppDataLocalTempappcfg1977774409461224969.tmp’

Scanning for jsp files.

Scanning files on local disk.

Initiating update.

Cloning 2 static files.

Cloning 23 application files.

 

Deploying:

Uploading 3 files.

Uploaded 1 files.

Uploaded 2 files.

Uploaded 3 files.

Initializing precompilation…

Sending batch containing 3 file(s) totaling 4KB.

Deploying new version.

Closing update: new version is ready to start serving.

Uploading index definitions.

 

Deployment completed successfully

 

 

Now let’s verify the GAE dashboard and verify the status of newly deployed application:

Application Status in GAE Dashboard

Figure 11- Application Status in GAE Dashboard

Let’s run the application:

 Available Servlets for an App in GAE

Figure 12 – Available Servlets for an App in GAE

Web Application in GAE Environment

Figure 13 – Web Application in GAE Environment

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s