I did exactly as described in this document to connect android app with firebase and app engine, till the connection of app module with the firebase everything is okay but the servlet part connection with firebase is not working and after calling the servlet from the browser I am getting errors
https://cloud.google.com/solutions/mobile/firebase-app-engine-android-studio
Using Dependencies in Backend module
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.34'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.firebase:firebase-server-sdk:3.0.3'
compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.50'
compile 'org.apache.httpcomponents:httpclient:4.5.3'
Getting this in android studio while running the backend
"C:\Program Files\Android\Android Studio\jre\bin\java" -javaagent:C:\Users\navinsoni\.gradle\appengine-sdk\appengine-java-sdk-1.9.34\lib\agent\appengine-agent.jar -Xbootclasspath/p:C:\Users\navinsoni\.gradle\appengine-sdk\appengine-java-sdk-1.9.34\lib\override\appengine-dev-jdk-overrides.jar -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files\Android\Android Studio\bin" -Dfile.encoding=windows-1252 -classpath "C:\Users\navinsoni\.gradle\appengine-sdk\appengine-java-sdk-1.9.34\lib\appengine-tools-api.jar;C:\Program Files\Android\Android Studio\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.google.appengine.tools.development.DevAppServerMain --address=localhost --port=8080 D:\ToDoApp\backend\build\exploded-app
Apr 03, 2017 8:22:15 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
There is a new version of the SDK available.
Latest SDK:
Release: 1.9.51
Timestamp: Fri Mar 24 01:37:57 IST 2017
API versions: [1.0]
Your SDK:
Release: 1.9.34
Timestamp: Fri Feb 12 01:06:15 IST 2016
API versions: [1.0]
Apr 03, 2017 8:22:18 AM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
INFO: Overwriting system property key 'java.util.logging.config.file', value 'C:\Users\navinsoni\.gradle\appengine-sdk\appengine-java-sdk-1.9.34\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'D:\ToDoApp\backend\build\exploded-app\WEB-INF\appengine-web.xml'
Apr 03, 2017 8:22:18 AM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Apr 03, 2017 8:22:19 AM com.google.appengine.tools.development.DevAppServerImpl setServerTimeZone
WARNING: Unable to set the TimeZone to UTC (this is expected if running on JDK 8)
Apr 03, 2017 8:22:19 AM com.google.apphosting.utils.jetty.JettyLogger info
INFO: jetty-6.1.x
Apr 03, 2017 8:22:21 AM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Started SelectChannelConnector@localhost:8080
Apr 03, 2017 8:22:21 AM com.google.appengine.tools.development.AbstractModule startup
INFO: Module instance default is running at localhost:8080/
Apr 03, 2017 8:22:21 AM com.google.appengine.tools.development.AbstractModule startup
INFO: The admin console is running at localhost:8080/_ah/admin
Apr 03, 2017 8:22:21 AM com.google.apphosting.utils.jetty.JettyLogger info
INFO: jetty-6.1.x
Apr 03, 2017 8:22:22 AM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Started SelectChannelConnector@localhost:59689
Apr 03, 2017 8:22:22 AM com.google.appengine.tools.development.AbstractModule startup
INFO: Module instance default instance 0 is running at localhost:59689/
Apr 03, 2017 8:22:22 AM com.google.appengine.tools.development.AbstractModule startup
INFO: The admin console is running at localhost:59689/_ah/admin
Apr 03, 2017 8:22:22 AM com.google.appengine.tools.development.DevAppServerImpl doStart
INFO: Dev App Server is now running
Apr 03, 2017 8:22:22 AM com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /_ah/start
And this is from the logs ! !
send-email
java.lang.NullPointerException
at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:213)
at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:127)
at com.google.api.client.util.ByteStreams.copy(ByteStreams.java:46)
at com.google.firebase.FirebaseOptions$Builder.setServiceAccount(FirebaseOptions.java:73)
at com.example.narayan.myapplication.backend.MyServlet.doGet(MyServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:37)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:48)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:257)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:145)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:635)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:595)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:565)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:453)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:460)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:293)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:319)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:311)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:457)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:238)
at java.lang.Thread.run(Thread.java:745)
User contributions licensed under CC BY-SA 3.0