Expect a short post. Deploying an app on Google App Engine is one of the easiest things I’ve ever done. If you haven’t done so, please start with part 1 of this tutorial in order to be at the point we are now.
To begin, let’s open up the sample Guestbook app that comes included with the Google App Engine package.
Important note: During my deployment I ran into a snag because I had used a space in the folder name for my project. If you cannot deploy your app, check this first.
Set Your Application Name
Your application name is the name you chose for your application when you created your account at the Google App Engine website. To set the application name, follow these instructions:
- Start the NetBeans IDE.
- Open the Guestbook sample app.
- Open the ./WEB-INF/appengine-web.xml file.
- Set the application name to match the application name you set up at Google App Engine.
Deploy Your App
- Right-click on your project in the Projects list
- Select “Deploy To Google App Engine”
- Fill in your Google Account credentials when prompted.
That’s it! At this point the code will compile and deploy. Once it’s done, open Firefox and browse to your app’s URL. It should be in perfect working order and ready to roll.
I hope that you’ve found this tutorial useful. If you have any suggestions or questions, please feel free to post them in the comments below!
I got the following error?!!!
Reading application configuration data…
Beginning server interaction for samatshi0…
0% Creating staging directory
5% Scanning for jsp files.
8% Compiling jsp files.
11% Compiling java files.
Error Details:
19 janv. 2010 15:22:49 org.apache.jasper.JspC processFile
INFO: Built File: \guestbook.jsp
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
Exception in thread “main”
Error while executing: C:\Program Files\Java\jre1.6.0\bin\javac.exe -classpath /C:/Program Files/appengine-java-sdk-1.3.0/appengine-java-sdk-1.3.0/lib/impl/appengine-api-labs.jar;/C:/Program Files/appengine-java-sdk-1.3.0/appengine-java-sdk-1.3.0/lib/impl/appengine-api-stubs.jar;/C:/Program Files/appengine-java-sdk-1.3.0/appengine-java-sdk-1.3.0/lib/impl/appengine-api.jar;/C:/Program Files/appengine-java-sdk-1.3.0/appengine-java-sdk-1.3.0/lib/impl/appengine-local-runtime.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\appengine-local-runtime-shared.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\geronimo-el_1.0_spec-1.0.1.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\geronimo-jsp_2.1_spec-1.0.1.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\geronimo-servlet_2.5_spec-1.2.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-ant-1.6.5.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-ant-launcher-1.6.5.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-commons-el-1.0.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-commons-logging-1.1.1.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-jasper-compiler-5.0.28.jar;C:\Program Files\appengine-java-sdk-1.3.0\appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-jasper-runtime-5.0.28.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\classes;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\appengine-api-1.0-sdk-1.3.0.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\appengine-api-labs-1.3.0.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\datanucleus-appengine-1.0.4.1.final.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\datanucleus-core-1.1.5.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\datanucleus-jpa-1.1.5.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\geronimo-jpa_3.0_spec-1.1.1.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\geronimo-jta_1.1_spec-1.1.1.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\jdo2-api-2.3-eb.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-ant-1.6.5.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-ant-launcher-1.6.5.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-commons-el-1.0.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-commons-logging-1.1.1.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-jakarta-jstl-1.1.2.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-jakarta-standard-1.1.2.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-jasper-compiler-5.0.28.jar;C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\lib\repackaged-appengine-jasper-runtime-5.0.28.jar; -d C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\classes -encoding UTF-8 C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1268.tmp\WEB-INF\classes\org\apache\jsp\guestbook_jsp.java
com.google.appengine.tools.admin.JspCompilationException: Failed to compile the generated JSP java files.
Unable to update app: Failed to compile the generated JSP java files.
Please see the logs [C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1267.log] for further information.
samatshi
19 Jan 10 at 11:10 am
The last line in that error dump reads:
“Please see the logs [C:\DOCUME~1\HP\LOCALS~1\Temp\appcfg1267.log] for further information.”
Can you paste the contents of that log?
John Rockefeller
21 Jan 10 at 8:02 pm
Problem and answer to help anyone else who has this error.
Error description, when I click Deploy To Google App Engine and it shows it is compiling JSP I get:
error:
java.lang.IllegalStateException: cannot find javac executable based on java.home, tried “C:\Program Files\Java\jre6\bin\javac.exe” and “C:\Program Files\Java\bin\javac.exe”
I am running Windows XP.
I Google searched and came up with this.
I had to edit the appcfg.cmd file found in
C:\…..\appengine-java-sdk-1.3.0\bin
The file contained a line:
@java -cp “%~dp0\..\lib\appengine-tools-api.jar” com.google.appengine.tools.admin.AppCfg %*
I changed the beginning of the line to follow the path I set in the windows environment to find the java jdk.
@”%JAVA_HOME%\bin\java” -cp “%~dp0\..\lib\appengine-tools-api.jar” com.google.appengine.tools.admin.AppCfg %*
Mark B
25 Jan 10 at 2:04 am
Perfect! Thank you so much for posting your solutions. You are helping others with the same issue who come after you looking for solutions.
Best regards,
John Rockefeller
25 Jan 10 at 1:40 pm
[...] Getting Started With Google App Engine and NetBeans Part 2 [...]
Getting Started With Google App Engine and NetBeans Part 1 « Developing in the Google Cloud
2 Feb 10 at 10:28 am
[...] http://rocky.developerblogs.com/tutorials/getting-started-with-google-app-engine-and-netbeans-part-2... [...]
How to setup Netbeans for Google App Engine with Scala « The Det about Programming
8 Feb 10 at 12:26 am
Everything works great until I go to publish to Google’s systems, at which point I receive the following error:
———————————————–
dirname: extra operand `AppEngine’
Try `dirname –help’ for more information.
Exception in thread “main” java.lang.NoClassDefFoundError: com/google/appengine/tools/admin/AppCfg
Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.admin.AppCfg
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
Could not find the main class: com.google.appengine.tools.admin.AppCfg. Program will exit.
———————————————–
Haven’t been able to track down the cause of this error, yet.
Any ideas?
Jason Ziemba
11 Feb 10 at 8:32 am
Check to make sure that there aren’t any spaces in your project name or folders. I had a similar error and that’s what fixed it. Let me know if that makes any difference
John Rockefeller
11 Feb 10 at 12:52 pm
Does the netbeans integration with GAE Python allow you to successfully debug an application?
Edwin
11 Feb 10 at 10:03 pm
Any ideia? The same as Jason Ziemba
dirname: operando extra `de’
Tente `dirname –help’ para mais informação.
Exception in thread “main” java.lang.NoClassDefFoundError: com/google/appengine/tools/admin/AppCfg
Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.admin.AppCfg
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
Could not find the main class: com.google.appengine.tools.admin.AppCfg. Program will exit.
dirname: operando extra `de’
Tente `dirname –help’ para mais informação.
Exception in thread “main” java.lang.NoClassDefFoundError: com/google/appengine/tools/admin/AppCfg
Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.admin.AppCfg
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
Could not find the main class: com.google.appengine.tools.admin.AppCfg. Program will exit.
Luis Augusto Machado Moretto
3 Mar 10 at 7:38 am
Thank you M. Rockefeller for those two articles.
I would be delighted if you could post a 3rd part on how to develop a sample app using JSF.
I was not able to have the example shown at the following address run correctly on Netbeans.
https://sites.google.com/a/wildstartech.com/adventures-in-java/Java-Platform-Enterprise-Edition/JavaServer-Faces/sun-javaserver-faces-reference-implementation/configuring-jsf-20-to-run-on-the-google-appengine
(the web page showed but all JSF tags were not rendered).
Thank you!
PC
Pierre Caron
11 Mar 10 at 9:20 pm
J have the same problem as Jason Ziemba?
Please help
lukasw44
16 Mar 10 at 6:57 pm
Perfect !!!!!!!!!
i implemented all the things a/c to your tutorial
Thank you so much……..
Dhanpati
31 Mar 10 at 7:13 pm
me using netbeans, linux inviroment. my 1st implementation done well
thanks
TMUkmkd
2 May 10 at 10:28 pm
Just wanted to say both parts of this post was helpful as well as the comments other users had. Had an issue with netbeans finding the gae sdk, googled a bit and didn’t find a solution. Came back to part 1 of the post and read the comments, someone (clark) mentioned having the same issue and needing an additional j2ee plugin to resolve it. Worked for me 2 and I was able to complete the rest of the steps in the post.
So I guess what I’m trying to say is … y’all rock!
segeboy
26 May 10 at 3:02 am
Anyboy know how to deploy from nb through a proxy?? I have set up NB with the right proxy host and port. But when deploy to GAE, it always fail with connection timeout. Same proxy host and port works well when use Eclipse to deploy to GAE. Looks like the plug-in has its own way of handling proxy. Please help.
senderj
13 Jul 10 at 9:54 pm
i installed this plugin in netbeans 6.9 but the “Deploy to Google App Engine” option is grayed out. any ideas?
mark
4 Aug 10 at 1:11 am
hello when I am trying to deploy my application in googleapps i could not i got the error java.exe cant run
error code 500
jalpa
17 Sep 10 at 5:55 am
I’ve tried using NetBeans 6.8 and 6.9.1 with appengine-java-sdk-1.3.7. When running locally I receive the following error:
BUILD FAILED
C:\Projects\gAppsEngine\Guestbook\build.xml:12: The following error occurred while executing this line:
C:\Projects\gAppsEngine\Guestbook\nbproject\build-impl.xml:22: Class org.apache.tools.ant.taskdefs.condition.Not doesn’t support the nested “antversion” element.
When deploying to the application I receive the following:
java.lang.UnsupportedClassVersionError: com/google/appengine/tools/admin/AppCfg (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread “main”
Any help would be appreciated.
Blake
14 Oct 10 at 7:04 am
The build was failing due to an old version of ant (1.6.5). I moved to 1.8.1 and it deployed locally successfully.
Blake
14 Oct 10 at 8:03 am
Hi
I am new to google app engine.i am using netbeans IDE 6.9.1. I need to fetch the data from the database using app engine. I dont know how to access the database
help me
thanks in advance
prabhu
25 Nov 10 at 5:35 am
In Netbeans 6.9.1 I get the following error message.
Could anyone help me with this?
\Guestbook\nbproject\build-impl.xml:683: Problem: failed to create task or type nbdeploy
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
BUILD FAILED (total time: 0 seconds)
Martijn Versluis
8 Feb 11 at 5:37 am
I found this problem. Please help me to resolve it
-cp: illegal argument
usage: java [-options] class
where options include:
-help print out this message
-version print out the build version
-v -verbose turn on verbose mode
-debug enable remote JAVA debugging
-noasyncgc don’t allow asynchronous garbage collection
-verbosegc print a message when garbage collection occurs
-noclassgc disable class garbage collection
-ss set the maximum native stack size for any thread
-oss set the maximum Java stack size for any thread
-ms set the initial Java heap size
-mx set the maximum Java heap size
-classpath
list directories in which to look for classes
-prof[:] output profiling data to .\java.prof or .\
-verify verify all classes when read in
-verifyremote verify classes read in over the network [default]
-noverify do not verify any class
-nojit disable JIT compiler
Do Phuong
9 Feb 11 at 2:25 am
I am getting following error. My netbeans proxies are set fine.
runserver:
[java] Mar 23, 2011 2:16:39 AM com.google.appengine.tools.info.RemoteVersionFactory getVersion
[java] INFO: Unable to access https://appengine.google.com/api/updatecheck?runtime=java&release=1.4.2×tamp=1297891083&api_versions='1.0'
[java] java.net.SocketException: Connection reset
[java] at java.net.SocketInputStream.read(Unknown Source)
[java] at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
[java] at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
[java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
[java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
[java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
[java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
[java] at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
[java] at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
[java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
[java] at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
[java] at java.net.URL.openStream(Unknown Source)
[java] at com.google.appengine.tools.info.RemoteVersionFactory.getVersion(RemoteVersionFactory.java:76)
[java] at com.google.appengine.tools.info.UpdateCheck.checkForUpdates(UpdateCheck.java:99)
[java] at com.google.appengine.tools.info.UpdateCheck.doNagScreen(UpdateCheck.java:174)
[java] at com.google.appengine.tools.info.UpdateCheck.maybePrintNagScreen(UpdateCheck.java:142)
[java] at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:150)
[java] at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
[java] at com.google.appengine.tools.development.DevAppServerMain.(DevAppServerMain.java:113)
[java] at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
[java] Mar 23, 2011 2:16:39 AM com.google.apphosting.utils.jetty.JettyLogger info
[java] INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
[java] Mar 23, 2011 2:16:39 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
[java] INFO: Successfully processed D:\Project\msc\sentiment-app\build\web\WEB-INF/appengine-web.xml
[java] Mar 23, 2011 2:16:39 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
[java] INFO: Successfully processed D:\Project\msc\sentiment-app\build\web\WEB-INF/web.xml
[java] Mar 22, 2011 8:46:39 PM com.google.apphosting.utils.jetty.JettyLogger info
[java] INFO: jetty-6.1.x
[java] Mar 22, 2011 8:46:40 PM com.google.apphosting.utils.jetty.JettyLogger info
[java] INFO: Started SelectChannelConnector@localhost:8080
[java] Mar 22, 2011 8:46:40 PM com.google.appengine.tools.development.DevAppServerImpl start
[java] INFO: The server is running at http://localhost:8080/
[java] Mar 22, 2011 8:46:43 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
[java] WARNING: No file found for: /favicon.ico
Suvrat
22 Mar 11 at 4:18 pm
Hello everyone!!even I am getting the same error as the above!! I have followed all the instructions to modify the apcfg.cmd and then ran it.But it still gives the jsp compilation error and the above one..!!!Someone Please Help!!!
Manoj Mahajan
17 Apr 11 at 11:45 am
Suvrat & Manoj Mahajan,
The above error is bcos google tries to get the details of its latest version of GAE and checks with the version in ur System..
But if you hit “http://localhost:8080/” in the browser it will work fine. The version exception can be ignored..
Manoj, if you can post the “jsp compilation error ” then can figure out the actual issue
Jugal
22 Apr 11 at 3:59 am
For win XP trobleshooting, here is mentioned page:
http://code.google.com/p/googleappengine/issues/detail?id=1226
for me worked the solution :
Edit the appcfg as
@set PATH=C:\Program Files\Java\jdk1.6.0_15\bin
@java -cp “%~dp0\..\lib\appengine-tools-api.jar”
com.google.appengine.tools.admin.AppCfg %*
sekol
24 Apr 11 at 1:20 pm
Thanks Rocky!
Thank everybody!
Good manual. After correction of some problems described in comments i successfully publish first project.
luno
11 Jul 11 at 4:09 pm
[...] Reference « Appzone-Analyzer integration plugin for Java [...]
Constantine » Getting Started With Google App Engine and NetBeans
21 Jul 11 at 7:23 am
java.io.IOException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=testApp&version=1.0&
400 Bad Request
I need help on this pls:
On deploying the sample app called guestbook, i got the following error.
Client Error (400)
The request is invalid for an unspecified reason.
Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=testApp&version=1.0&
400 Bad Request
Client Error (400)
The request is invalid for an unspecified reason.
Lionel
21 Oct 11 at 11:23 am
Dear John. Thank you for this tutorial. It helps me.
I use Netbeans 6.8 and appengine-java-sdk-1.6.1
My projects works well in localhost:8080 but when I try to deploy project (changing appengine-web.xml) to Google I see:
The filename, directory name, or volume label syntax is incorrect.
appcfg.cmd was chenged to:
“%JAVA_HOME%\bin\java” -cp “%~dp0\..\lib\appengine-tools-api.jar” com.google.appengine.tools.admin.AppCfg %*
@echo %JAVA_HOME% in Command Prompt –>
C:\Program Files (x86)\Java\jdk1.6.0_26
Please help me find solution for this problem. Thanks.
bd_vic
8 Jan 12 at 12:56 am
@rocky1138 :Thanks
Vinay
8 Jan 12 at 6:56 am
The problem was here: Program Files ( – spaces in JAVA_HOME
Sorry and thanks
bd_vic
8 Jan 12 at 12:01 pm