If you have been following this blog, the version of the Google App Engine SDK was 1.2.5. Recently Google announced a release 1.2.6 of its App Engine SDK.
I think you should upgrade to the latest version since it a very cool feature that resonates with an earlier episode titled Episode 3: Using the GAEJ Email Service. That episode covered using the Email Service that allows you to send an email from your GAEJ application. The latest release 1.2.6 of the App Engine SDK for Java allows you to receive incoming emails too in your application. And that will be the topic in the next episode, so I thought it is best that I mention here that it is time to upgrade to version 1.2.6 of the App Engine SDK.
Here are a few steps and points to note to upgrade to version 1.2.6 of the SDK. I am assuming that all your development/deployment is being done via the Google App Engine plugin for Eclipse since that is what we have used throughout this series. Here are the steps:
1. Launch the version of Eclipse that you have been using so far for the GAEJ development.
2. Go to Window –> Preferences. And then click on Google –> App Engine. You can see the version of the App Engine SDK and most likely it is 1.2.5
3. Stay in Preferences and go one level higher in the tree on the left to Google. You will see a tiny checkbox that mentions “Notify me about updates”. If you have this selected, then you should have already got a notification status in the status bar in Eclipse, somewhere in the bottom of the screen. It looks something like this:
Clicking on this link would bring up a dialog that looks like the one shown below:
Depending on your version of Eclipse, you might see a different message and maybe the menu options might be slightly different but the process is a standard one in Eclipse to update your plugins.
4. Even if you had deselected the option to Notify about updates, the process to upgrade the plugin/SDK to the latest version 1.2.6 is the same. Go to Help –> Check for Updates in the main menu. This is for version 3.5 of Eclipse that I use (Galileo version).
This will bring up a dialog and show all your installed components/plugins in Eclipse that have a newer version (update) for you to install. A sample screenshot from my Eclipse setup is shown below:
5. Select only the Google specific upgrades. You should be able to see the version 1.2.6 of the SDK shown as above. Click on the Next button. This will confirm the updates as shown below:
Click on Next, accept all the terms as shown below and proceed with Finish appropriately.
This will download, install the update to the SDK. I recommend to restart Eclipse as prompted.
Post Installation Steps
The following two steps are very important in order to start using the latest version correctly. This is what worked for me and I am not sure if there are other things that are still required but this two steps should suffice for now:
1. Make sure that all your projects moving forward use version 1.2.6 of the SDK. This is not mandatory but required if you wish to use the new features available in version 1.2.6. To do this, go to Window –> Preferences. Click on Google –> App Engine as shown below:
In this screen, you are seeing only only entry for the version 1.2.6 of the SDK. Normally you will see more than one (the older 1.2.5 SDK) will also be shown and it will be the default selected one. You are not seeing it over here in my setup, because I deleted it and am using only 1.2.6 of the SDK as shown. Select and you will find that as mentioned in the dialog above, the checked SDK will be used by default for newly created projects.
2. Google App Engine SDK also ships with a development server that you can use for local testing. We will be using it in the next episode. You can simply right click any project in the project hierarchy and select Run As –> Web Application to launch your GAEJ application in the development server. The development server is automatically started as you will notice in the console window and you can access your application at http://localhost:8080. But an additional step now needs to be performed to help the development server start. This has got added since version 1.2.6 — it looks like that. Follow the next steps to get this correctly setup.
3. Select the project you want to run in the Project Hierarchy on left. Right click it and select Run As –> Run Configurations… as shown below:
4. This will bring up the Run Configuration as shown below. Notice the Error message displayed which I have highlighted in Yellow.
5. So all you need to do is add the VM Argument that they are mentioning. Simply copy the string starting from -javaagent to the end. And paste it in the VM Arguments field in the same dialog as shown below:
You will find that the error message will go away. You can click Run now to execute the Web Application. The server will be able to start successfully now.
This completes the upgrade of your Google plugin to version 1.2.6 of the SDK.
Make sure that you have version 1.2.6 of the SDK setup as mentioned in this episode. The next episode coming in a day will show how your Google App Engine applications can receive incoming emails, which is one of the newly enabled features of version 1.2.6 of the SDK. Till then, happy upgrading!