PassProtect

Friday 23 December 2011

Import GWT/ Google App Engine project to Eclipse in Linux "Unable to locate the App Engine agent." error

Another happy episode of Ubuntu quirks.
I'm an Eclipse newbie (been using Netbeans for its straightforward interface and fairly intuitive project management tools) so it's natural that I may be bothered by all sorts of intricacies that don't come in handy all the time.
Configuration: Ubuntu 11.10, Eclipse Indigo, Open JDK

So, I've got this Google App Engine & GWT project on SVN, checked it out somewhere on my local filesys. Mind you, the project is already an Eclipse one, and my installation of Eclipse already has installed GWT, Google App Engine and all that magic. So I'm thinking, everything should work smooth, right? Wrong. Try to run project as Web Application, start web server, and naturally error occurs:

java.lang.RuntimeException: Unable to locate the App Engine agent.
Please use dev_appserver, KickStart,  or set the jvm flag: "-
javaagent:<sdk_root>/lib/agent/appengine-agent.jar" 


Luckily, after a bit of search I found this really useful post and did what the smart guys and girls say there.
Click on project > select Run As...> Run Configurations > selected from the left the google project html page > click Arguments tab > paste in VM Arguments the exact javaagent flag they're quoting in the error message, replacing <sdk_root> with your Google App Engine SDK location. In my case, the path was this:
/usr/lib/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.5.5.r37v201110112027/appengine-java-sdk-1.5.5/lib/agent/appengine-agent.jar

Another friendly advice found out the hard way. If you're working with GWT, Google App Engine(GAE) and have Eclipse Indigo (i.e., you got the juice by way of installing plugins from http://dl.google.com/eclipse/plugin/3.7 ),  use JDK 1.6. This is what did good things for my colleagues and me.

Click-right on project > Properties > Java Compiler > Compiler Compliance Levels: make sure 1.6 is selected. Even if you've upgraded to 1.7, it's useless - GAE and GWT will scream and not function as expected. It'll save you 2h of F words.

No comments:

Post a Comment