Google App Engine Tutorial Hello World Example won't run - google-app-engine

I am having difficulty getting to the starting line on my machine.
1) Windows 7 32bit all service packs installed
2) Installed JDK 1.7.0_21
3) Checked PATH that only one copy of JDK\bin is in path and that it is correct.
4) Installed Eclipse Juno Java bundle. eclipse-java-juno-SR2-win32.zip
5) Install Google App Engine SDK per the tutorial using:
https://dl.google.com/eclipse/plugin/4.2
Selected:
- Google Plugin for Eclipse
- GWT
- SDK
Did NOT select:
- Developer Tools (Android)
- Google App for Android
- NDK Plugins
6) Following the tutorial, pull down the Google Icon and select "New Web Application Project"
- Name it Guestbook as shown
- Uncheck GWT
- Check Google App Engine
- Finish
7) Following the tutorial, Run as Web Application
At this point, the console shows several successful steps and then crashes and burns with jetty unable to establish a loop back connection. The full console output is attached below. I have searched all over the web and have not been able to find anything. I checked PATH and JDK. I checked the Windows firewall rule for Eclipse, it looks OK. I looked at the Classpath tab but could not see anything obviously wrong (although I don't know what it is supposed to look like)
Full Console Output
Jun 15, 2013 2:56:51 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed E:\User Data\Dave\Documents\Google App Engine Scratch\Guestbook\war\WEB-INF/appengine-web.xml
Jun 15, 2013 2:56:51 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed E:\User Data\Dave\Documents\Google App Engine Scratch\Guestbook\war\WEB-INF/web.xml
Jun 15, 2013 2:56:51 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
INFO: Overwriting system property key 'java.util.logging.config.file', value 'E:\Eclipse Google App Engine\eclipse\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.8.1\appengine-java-sdk-1.8.1\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'E:\User Data\Dave\Documents\Google App Engine Scratch\Guestbook\war\WEB-INF\appengine-web.xml'
Jun 15, 2013 2:56:51 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jun 15, 2013 7:56:52 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: jetty-6.1.x
Jun 15, 2013 7:56:54 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed org.mortbay.jetty.nio.SelectChannelConnector$1#15321fc: java.io.IOException: Unable to establish loopback connection
Jun 15, 2013 7:56:54 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed SelectChannelConnector#127.0.0.1:8888: java.io.IOException: Unable to establish loopback connection
Jun 15, 2013 7:56:54 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed Server#150305e: java.io.IOException: Unable to establish loopback connection
java.io.IOException: Unable to establish loopback connection
at sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
at sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.ch.PipeImpl.<init>(Unknown Source)
at sun.nio.ch.SelectorProviderImpl.openPipe(Unknown Source)
at java.nio.channels.Pipe.open(Unknown Source)
at sun.nio.ch.WindowsSelectorImpl.<init>(Unknown Source)
at sun.nio.ch.WindowsSelectorProvider.openSelector(Unknown Source)
at java.nio.channels.Selector.open(Unknown Source)
at org.mortbay.io.nio.SelectorManager$SelectSet.<init>(SelectorManager.java:312)
at org.mortbay.io.nio.SelectorManager.doStart(SelectorManager.java:223)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:314)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.Server.doStart(Server.java:235)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:249)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:307)
at com.google.appengine.tools.development.AutomaticServerInstanceHolder.startUp(AutomaticServerInstanceHolder.java:26)
at com.google.appengine.tools.development.AbstractServer.startup(AbstractServer.java:80)
at com.google.appengine.tools.development.Servers.startup(Servers.java:82)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:237)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:339)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:274)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:250)
Caused by: java.net.ConnectException: Connection refused: connect
at sun.nio.ch.Net.connect0(Native Method)
at sun.nio.ch.Net.connect(Unknown Source)
at sun.nio.ch.Net.connect(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at java.nio.channels.SocketChannel.open(Unknown Source)
... 26 more

PROBLEM SOLVED!
I was able to absolutely nail the cause of this problem and fix it.
What I did was removed the JRE and JDK from "C:\Program Files\Java\" (which is where Oracle's installer puts them by default) and reinstalled them in "C:\Java\Java7\" Apparently something in Eclipse and/or the Google Android development kit is still sensitive to spaces in the pathname to the JDK. This is an ancient general problem with Eclipse reported around 2005.
I did NOT need to drop down to Java 6
I did NOT need to edit Eclipse.ini and add a -VM line
I did NOT need to manually add the path to the jdk to PATH
Hope this helps the next person because this is an incredibly frustrating problem when you encounter it.
Thanks!
David Hetherington

Problem: Trying to run the 'Hello World' app using google eclipse plugin (eclipse - Kepler).
Solution: Adding to David's answer. If you have multiple jre's installed make sure the jre you are pointing to does not have a space in the absolute path. To change the jre you are pointing to go to eclipse - window->preferences->server->runtime environments->google app engine->edit. Now check the jre version you are pointing to. In my case I had jdk 1.7 installed in Program Files/Java and jre6 and jre7 installed in the same location. I moved jdk 1.7 to Program_files but was still getting the loopback error. Followed the above steps and pointed the jre version to the one in jdk1.7/jre in Program_files/java as earlier it was pointing to C:/Program Files/java/jre7
Hope this helps someone.

Are you sure you don't have anything else running with the same PORT number as the web-application? Default webapplication PORT is 8888

Related

Exception Processing Mirror-Quickstart

I ran the mvn war:war in the command prompt, I then went to upload to appengine using appcfg update and I got this error. The app works on localhost. Aside from the path simply being wrong, there is no appengine-web.xml. Any help would be appreciated thankyou.
C:\appengine-java-sdk\bin>appcfg update C:\mirror-quickstart-java-master
Reading application configuration data...
Aug 31, 2013 7:10:33 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SEVERE: Received exception processing C:/mirror-quickstart-java-master\WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Could not locate C:\mirror-quickstart-java-master\WEB-INF\appengine-web.xml
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:140)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.readAppEngineWebXml(AppEngineWebXmlReader.java:75)
at com.google.appengine.tools.admin.Application.<init>(Application.java:182)
at com.google.appengine.tools.admin.Application.readApplication(Application.java:319)
at com.google.appengine.tools.admin.AppCfg.readWar(AppCfg.java:279)
at com.google.appengine.tools.admin.AppCfg.readApplication(AppCfg.java:270)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:208)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:121)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:117)
Caused by: java.io.FileNotFoundException: C:\mirror-quickstart-java-master\WEB-INF\appengine-web.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:97)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137)
... 8 more
Bad configuration: Could not locate C:\mirror-quickstart-java-master\WEB-INF\appengine-web.xml
Caused by: C:\mirror-quickstart-java-master\WEB-INF\appengine-web.xml (The system cannot find the path specified)
Please see the logs [C:\Users\Hasan\AppData\Local\Temp\appcfg4724142030047376778.log] for further information.
The latest version of the mirror-quickstart-java that supports Google App Engine has been tagged with app-engine; you should use this specific release.

Google app engine sdk is using JRE Not JDK

I am not using eclipse, using GAE SDK to upload my project, problem is when i am trying to upload it is using jre not jdk thats the reason i am getting below error, please help how can i force app engine sdk to use JDK instead of jre
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\j1013366\Desktop\social.login.2013\appengine-java-sdk-1.8.0\appengine-j
ava-sdk-1.8.0\bin>appcfg.cmd update apps/SocialLoginProject
Reading application configuration data...
Jun 05, 2013 12:22:45 PM com.google.apphosting.utils.config.AppEngineWebXmlReade
r readAppEngineWebXml
INFO: Successfully processed apps/SocialLoginProject\WEB-INF/appengine-web.xml
Jun 05, 2013 12:22:45 PM com.google.apphosting.utils.config.AbstractConfigXmlRea
der readConfigXml
INFO: Successfully processed apps/SocialLoginProject\WEB-INF/web.xml
Jun 05, 2013 12:22:45 PM com.google.apphosting.utils.config.IndexesXmlReader rea
dConfigXml
INFO: Successfully processed apps\SocialLoginProject\WEB-INF\appengine-generated
\datastore-indexes-auto.xml
Beginning interaction for server default...
0% Created staging directory at: 'C:\Users\j1013366\AppData\Local\Temp\appcfg152
7926604447976257.tmp'
5% Scanning for jsp files.
8% Compiling jsp files.
Error Details:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilation
Context.java:238)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilation
Context.java:214)
at org.apache.jasper.JspC.processFile(JspC.java:1181)
at org.apache.jasper.JspC.execute(JspC.java:1341)
at com.google.appengine.tools.development.LocalJspC.main(LocalJspC.java:
40)
Caused by: java.lang.NullPointerException
at com.google.appengine.tools.development.LocalJspC$LocalCompiler.<clini
t>(LocalJspC.java:53)
... 7 more
com.google.appengine.tools.admin.JspCompilationException: Failed to compile jsp
files.
Unable to update app: Failed to compile jsp files.
Please see the logs [C:\Users\j1013366\AppData\Local\Temp\appcfg5225288314554557
20.log] for further information.
C:\Users\j1013366\Desktop\social.login.2013\appengine-java-sdk-1.8.0\appengine-j
ava-sdk-1.8.0\bin>
Personally I have intentionally set it up to use the JRE from within the SDK by modifying appcfg.cmd to
"%JAVA_HOME%\bin\java" -Djava.home="%JAVA_HOME%\jre" -Xmx1100m -cp "%~dp0\..\lib\appengine-tools-api.jar" com.google.appengine.tools.admin.AppCfg %*
and setting JAVA_HOME to point to the JDK.
I am guessing you could modify -Djava.home="%JAVA_HOME%\jre" to point to wherever you like.

java.net.UnknownHostException: appengine.google.com

Got this error. Any idea how to get rid of it?
Yesterday it was working fine but today I got these errors. I saw a known issue with this - link. But I didn't find any solution yet..
Oct 16, 2012 4:01:59 PM com.google.appengine.tools.info.RemoteVersionFactory getVersion
INFO: Unable to access https://appengine.google.com/api/updatecheck?runtime=java&release=1.7.1&timestamp=1345058163&api_versions=['1.0']
java.net.UnknownHostException: appengine.google.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at java.net.URL.openStream(URL.java:1010)
at com.google.appengine.tools.info.RemoteVersionFactory.getVersion(RemoteVersionFactory.java:76)
at com.google.appengine.tools.info.UpdateCheck.checkForUpdates(UpdateCheck.java:99)
at com.google.appengine.tools.info.UpdateCheck.doNagScreen(UpdateCheck.java:174)
at com.google.appengine.tools.info.UpdateCheck.maybePrintNagScreen(UpdateCheck.java:142)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:289)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:249)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:225)
Oct 16, 2012 4:01:59 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Oct 16, 2012 4:02:00 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed D:\WorkSpace\GAE\GST\war\WEB-INF/appengine-web.xml
Oct 16, 2012 4:02:00 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed D:\WorkSpace\GAE\GST\war\WEB-INF/web.xml
Oct 16, 2012 4:02:02 PM com.google.appengine.tools.development.DevAppServerImpl start
If you are using Java 8 in your app engine application, you will need to include
<url-stream-handler> urlfetch </ url-stream-handler>
in appengine-web.xml.
appengine-web.xml Reference
I am assuming that you are seeing this in your Eclipse IDE when you are trying to run the Eclipse Project as a Web Application.
The GAE plugin simply checks if there is an updated AppEngine SDK available for download. If there is a newer one than the one you are currently using then it lets you know that. The error is because at that instance, there was probably a network error and it got not connect through. It is harmless as far as running your application is concerned.
But if your application is dependent on accessing some external network services, then chances are that they might fail also if the network issue persists in your development environment.
got it working.. : cmd->goto your home directory >mkdir .appcfg_no_nag this will stop checking for the update and yourweb app willrun locally atleast..
This error is related to internet connection. I changed to other connection, it works
You should add in appengine-web.xml:
<url-stream-handler> urlfetch </ url-stream-handler>
And also start using java.net.URLConnection,
Apache HttpClient is not gonna work for example.
https://cloud.google.com/appengine/docs/standard/java/issue-requests#java_8_runtime_vs_java_7_behavior

App Engine doesn't find WEB-INF in WAR created by sbt

I'm trying to make a Lift app that I can run on App Engine and am managing the project with sbt. I have web.xml and appengine-web.xml in src/main/webapp/WEB-INF and package the project with sbt project. According to a previous SO quesiton, that should be all I need. However, I get this:
$ dev_appserver.sh target/scala_2.8.1/
2011-02-06 13:37:45.763 java[20355:903] [Java CocoaComponent compatibility mode]: Enabled
2011-02-06 13:37:45.765 java[20355:903] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000
Feb 6, 2011 12:37:47 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
com.google.apphosting.utils.config.AppEngineConfigException: Supplied application has to contain WEB-INF directory.
at com.google.appengine.tools.development.JettyContainerService.determineAppRoot(JettyContainerService.java:319)
at com.google.appengine.tools.development.JettyContainerService.initContext(JettyContainerService.java:145)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:146)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
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)
Any ideas why? Thanks.
Sorry, I just figured out the problem after submitting the question. The following invocation of the dev server works: dev_appserver.sh target/scala_2.8.1/webapp

Tomcat runs but complains about missing server.xml

I'm using ubuntu 9.10 and I installed java and tomcat using the package manager. When I went to run startup.sh, it first complains about catalina.out not being there and not being writable. I fixed that and it doesn't complain about that (why isn't that included in the install??) Now it's complaining about server.xml not being there when I shut down the server. Here is my output from command line:
user#desktop:/usr/share/tomcat6$ ./bin/startup.sh
Using CATALINA_BASE: /usr/share/tomcat6
Using CATALINA_HOME: /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME: /usr/lib/jvm/java-6-sun-1.6.0.15
user#desktop:/usr/share/tomcat6$ ./bin/shutdown.sh
Using CATALINA_BASE: /usr/share/tomcat6
Using CATALINA_HOME: /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME: /usr/lib/jvm/java-6-sun-1.6.0.15
Dec 11, 2009 4:42:57 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.io.FileNotFoundException: /usr/share/tomcat6/conf/server.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
user#desktop:/usr/share/tomcat6$
I'm really new to tomcat so this might be a dumb question, but why isn't there a sample server.xml in a fresh install of tomcat? What can I put in there to shut it up... even if its just a stub and a +1 to any one who can explain to me the structure of this file?
Try using server.xml located at:
/etc/tomcat6/server.xml
server.xml is the configuration file for the application server. It contains stuff like what port is the server going to listen at, where are the applications being deployed, and other related stuff.
More info on Tomcat in Ubuntu:
https://help.ubuntu.com/12.04/serverguide/tomcat.html

Resources