Posts

In this blog post I will explain how you can add your own domain to a Google AppEngine Application. I will start from scratch just to show you how it works.
1. First of all, make sure you are signed in into Google AppEngine. Navigate to the Dashboard and create a new Application:

Google AppEngine Dashboard with Applications

Google AppEngine Dashboard with Applications


2. Create a new application by clicking on “Create Application”. On the next dialog, you need to specify some data about the application. This is the application identifier, a description and how the application will be accessed. We’ll select the “open for all” option, as we want our application to be generally available. Once this step is completed, you will see the “application created” page.
Create a new Application on Google AppEngine

Create a new Application on Google AppEngine


3. Next, we will navigate to the overview again and select our newly created application. Navigate down until you reach the section “Administration”. Select “Application Settings”.
Google AppEngine Settings

Google AppEngine Settings


4. In the “Application Settings” Dialog for Google AppEngine, scroll down until you reach the section “Domain Setup”. Click on “Add Domain”.  You are now redirected to a page where you can configure your domain.
Google AppEngine Domain Setup

Google AppEngine Domain Setup


5. To use Google AppEngine with your domain, you need to setup a Google Apps Account. Google Apps Standard is free and that is basically what I am also using. If you already have your Google Apps Account, you can skip the next steps until step 10. Click next on the first dialogs until you reach the domain verification page. On this page, select your domain host and authentify against it.
Google AppEngine Add Domain Name

Google AppEngine Add Domain Name


Google create new Google Apps Account

Google create new Google Apps Account


 
6. You might be asked about your domain registrar. Most of the time, it simply says “take me to …” for your domain registrar but it might also ask you for your registrar’s name in case you couldn’t be identified.
Google Apps select the domain registrar

Google Apps select the domain registrar


7. Log in to your domain registrar.
Google Apps log in to GoDaddy

Google Apps log in to GoDaddy


8. Authorise Google Apps to identify with your registrar
Verify Google Apps to change to Godaddy

Verify Google Apps to change to Godaddy


9. The domain verification and associated update of domain settings might take a while (up to 48hrs). However, you can now go back to the Dialog where it says “add Domain”.
Google AppEngine add the Google Apps Domain

Google AppEngine add the Google Apps Domain


10. Enter the domain name in the text box and click “Add”. You are now redirected to Google Apps, where your permission is required to use this domain. Simply click on “Agree” on the Terms.
11. Now you are on the page with the domain administration. Click on “add new URL”
Google AppEngine add the top-level domain with "www"

Google AppEngine add the top-level domain with “www”


12. Normally, you can only add some subdomains. However, this might not be that smart all time so I would recommend adding something like a top-level domain for it.  You can do this by adding “www” on the dialog.
13. Now you have to do some manual steps with your domain registrar – e.g. Godaddy. Google explains what you have to do so simply follow these steps.
14. You are ready to host your AppEngine Application on your domain now! Have fun!
 
 

I recently came across a significant problem with Google AppEngine 1.7.2 and Jersey. Whenever I tried to implement my Webservice, I got a 500 error. There was nothing really wrong with the code. So i took a look at the Logs in the Google AppEngine Dashboard and found the following exception:
 
//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js //
 

Uncaught exception from servlet
java.lang.IncompatibleClassChangeError: Implementing class
	at com.google.appengine.runtime.Request.process-642025ace6e60966(Request.java)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:68)
	at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:110)
	at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:76)
	at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:87)
	at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:641)
	at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:619)
	at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:199)
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:307)
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:470)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
	at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:452)
	at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:458)
	at com.google.tracing.TraceContext.runInContext(TraceContext.java:698)
	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:336)
	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:328)
	at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:456)
	at java.lang.Thread.run(Thread.java:679)
This exception is caused by compatibility issues between asm-4.0.jar and asm-3.1.jar. With the new Version of AppEngine, asm-4.0.jar is used and it is not compatible with Jersey, which relies on asm-3.1.jar. To make Jersey still work on GAE 1.7, you have to remove the dependency on asm-4.0.jar.

[widgets_on_pages id=”sb”]

To remove the dependency, simply right-click on the referenced library "asm-4.0.jar", select "Build Path" and click on "Remove from Build Path". You also have to remove the file physically.
However, now that you changed that, you will still run into other problems. Datanucleus 2.0 relies on asm-4.0.jar and now that we removed the dependency, we can't use it any more. Therefore, it is necessary to switch to Version 1.0. You can do this simply by right-clicking on the project - select "Google" - "App Engine Settings". In this dialog, simply switch to Version 1.0 and you are ready to go (again)
Set Datanucelus Version to 1.0 in Eclipse for AppEngine

Set Datanucelus Version to 1.0 in Eclipse for AppEngine

[widgets_on_pages id=”sb”]
[widgets_on_pages id=3]

The most popular Posts: