Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of java.lang.RuntimeException: Unable to locate the App Engine agent in Eclipse Helios?

   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"
at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:102)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:77)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:38)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:154)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
  Caused by: java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent
at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:98)
... 6 more
   Caused by: java.lang.ClassNotFoundException:    com.google.appengine.tools.development.agent.AppEngineDevAgent
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 7 more

I searched on google and they asked to change VM Argument. Those answers are not working with my eclipse. May be because those answers were for old versions of eclipse. Can anyone please help me with that?

Thanks in Advance.

like image 676
Piscean Avatar asked Jun 15 '11 09:06

Piscean


4 Answers

Go to your project properties > java build path > edit your app engine sdk and configure it. Add the latest sdk there and problem will be solved.

like image 90
Piscean Avatar answered Nov 19 '22 13:11

Piscean


I did the same thing, only the error still wouldn't go. However, you also need to remove all previously installed SDKs for everything to work.

like image 2
raghavsethi Avatar answered Nov 19 '22 13:11

raghavsethi


I happened to get this problem over and over again, because my project's run configuration kept forgetting the -javaagent VM parameter. In Eclipse, in the menu bar, select Run -> Run Configurations ... -> Web Application (blue Google-g) -> select the run configuration that's making problems. Select Tab "Arguments". In the "VM arguments" textbox, add the following entry, configuring it to your unique path and unique Eclipse GAE SDK version:
-javaagent:C:\path-to-your-eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.6.4.v201203300216r37\appengine-java-sdk-1.6.4\lib\agent\appengine-agent.jar
Click "Apply" and then give "Run" a try.

like image 6
Abdull Avatar answered Nov 19 '22 14:11

Abdull


This can also happen if there are two or more Google App Engine SDK libraries included in the build path. It happened to me where I had included the libs from my project while also including the ones installed via Eclipse.

The best way to check this is go to Project Properties > Java Build Path > Ensure that only one appengine-api-* (* is a wildcard for the filenames). The Eclipse installed SDK's are included under "App Engine SDK".

An image of what I'm talking about is below

enter image description here

like image 1
Hengjie Avatar answered Nov 19 '22 14:11

Hengjie