Could not initialize class FirebaseThreadManagers error on Firebase












3














I'm attempting to manipulate my Firebase database from Google App Engine. Having followed tutorials, I'm getting the following error -




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers




Sometimes I see the following:




org.slf4j.LoggerFactory is a restricted class. Please see the Google  App Engine developer's guide for more details.



The error occurs at FirebaseOptions, as seen in my code below.



        FileInputStream serviceAccount = new FileInputStream("WEB-INF/MyApp.json");

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://MyApp.firebaseio.com")
.build();

FirebaseApp.initializeApp(options);


Here's the error in full




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers
at com.google.firebase.FirebaseOptions$Builder.(FirebaseOptions.java:147)
at com.example.name.myapplication.backend.MyServlet.doGet(MyServlet.java:55)
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.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirectedModuleRequest(DevAppServerModulesFilter.java:415)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:128)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at com.google.appengine.tools.development.JettyContainerService.forwardToServer(JettyContainerService.java:458)
at com.google.appengine.tools.development.Modules.forwardToInstance(Modules.java:372)
at com.google.appengine.tools.development.DelegatingModulesFilterHelper.forwardToInstance(DelegatingModulesFilterHelper.java:95)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirect(DevAppServerModulesFilter.java:326)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:119)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:511)
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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)




Here's my build.gradle for the backend



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
}
}

repositories {
jcenter();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.firebase:firebase-admin:5.5.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'


appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
}


Top level build file:



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}

allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}









share|improve this question
























  • You tagged this with both "android" and "google-app-engine". Seems like it should be one or the other, but not both. Are you using the firebase-admin SDK on GAE?
    – Doug Stevenson
    Nov 30 '17 at 20:02










  • Sorry, yes. I'm using Google App Engine as a backend for my Android app. This is solely to do with GAE. I am using Firebase-admin SDK. It's one of my dependencies alongside firebase-database and firebase-core.
    – PSLDev
    Nov 30 '17 at 20:06










  • I just tested your exact build.gradle, and it worked fine for me. My gut feeling is that having the android plugins in your project has left it in an inconsistent state. I would recommend cleaning the project directory (gradle clean), and try to re-execute the app.
    – Hiranya Jayathilaka
    Nov 30 '17 at 22:09












  • I've tried that and no difference. Gradle builds fine but when the Servlet is called I get that error. Please see my edit for another error I sometimes see, occurs at the same line - Firebase options.
    – PSLDev
    Dec 1 '17 at 0:54










  • can you please post your toplevel buildfile?
    – Michael Meyer
    Dec 1 '17 at 10:07
















3














I'm attempting to manipulate my Firebase database from Google App Engine. Having followed tutorials, I'm getting the following error -




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers




Sometimes I see the following:




org.slf4j.LoggerFactory is a restricted class. Please see the Google  App Engine developer's guide for more details.



The error occurs at FirebaseOptions, as seen in my code below.



        FileInputStream serviceAccount = new FileInputStream("WEB-INF/MyApp.json");

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://MyApp.firebaseio.com")
.build();

FirebaseApp.initializeApp(options);


Here's the error in full




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers
at com.google.firebase.FirebaseOptions$Builder.(FirebaseOptions.java:147)
at com.example.name.myapplication.backend.MyServlet.doGet(MyServlet.java:55)
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.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirectedModuleRequest(DevAppServerModulesFilter.java:415)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:128)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at com.google.appengine.tools.development.JettyContainerService.forwardToServer(JettyContainerService.java:458)
at com.google.appengine.tools.development.Modules.forwardToInstance(Modules.java:372)
at com.google.appengine.tools.development.DelegatingModulesFilterHelper.forwardToInstance(DelegatingModulesFilterHelper.java:95)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirect(DevAppServerModulesFilter.java:326)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:119)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:511)
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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)




Here's my build.gradle for the backend



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
}
}

repositories {
jcenter();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.firebase:firebase-admin:5.5.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'


appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
}


Top level build file:



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}

allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}









share|improve this question
























  • You tagged this with both "android" and "google-app-engine". Seems like it should be one or the other, but not both. Are you using the firebase-admin SDK on GAE?
    – Doug Stevenson
    Nov 30 '17 at 20:02










  • Sorry, yes. I'm using Google App Engine as a backend for my Android app. This is solely to do with GAE. I am using Firebase-admin SDK. It's one of my dependencies alongside firebase-database and firebase-core.
    – PSLDev
    Nov 30 '17 at 20:06










  • I just tested your exact build.gradle, and it worked fine for me. My gut feeling is that having the android plugins in your project has left it in an inconsistent state. I would recommend cleaning the project directory (gradle clean), and try to re-execute the app.
    – Hiranya Jayathilaka
    Nov 30 '17 at 22:09












  • I've tried that and no difference. Gradle builds fine but when the Servlet is called I get that error. Please see my edit for another error I sometimes see, occurs at the same line - Firebase options.
    – PSLDev
    Dec 1 '17 at 0:54










  • can you please post your toplevel buildfile?
    – Michael Meyer
    Dec 1 '17 at 10:07














3












3








3







I'm attempting to manipulate my Firebase database from Google App Engine. Having followed tutorials, I'm getting the following error -




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers




Sometimes I see the following:




org.slf4j.LoggerFactory is a restricted class. Please see the Google  App Engine developer's guide for more details.



The error occurs at FirebaseOptions, as seen in my code below.



        FileInputStream serviceAccount = new FileInputStream("WEB-INF/MyApp.json");

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://MyApp.firebaseio.com")
.build();

FirebaseApp.initializeApp(options);


Here's the error in full




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers
at com.google.firebase.FirebaseOptions$Builder.(FirebaseOptions.java:147)
at com.example.name.myapplication.backend.MyServlet.doGet(MyServlet.java:55)
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.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirectedModuleRequest(DevAppServerModulesFilter.java:415)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:128)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at com.google.appengine.tools.development.JettyContainerService.forwardToServer(JettyContainerService.java:458)
at com.google.appengine.tools.development.Modules.forwardToInstance(Modules.java:372)
at com.google.appengine.tools.development.DelegatingModulesFilterHelper.forwardToInstance(DelegatingModulesFilterHelper.java:95)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirect(DevAppServerModulesFilter.java:326)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:119)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:511)
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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)




Here's my build.gradle for the backend



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
}
}

repositories {
jcenter();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.firebase:firebase-admin:5.5.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'


appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
}


Top level build file:



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}

allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}









share|improve this question















I'm attempting to manipulate my Firebase database from Google App Engine. Having followed tutorials, I'm getting the following error -




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers




Sometimes I see the following:




org.slf4j.LoggerFactory is a restricted class. Please see the Google  App Engine developer's guide for more details.



The error occurs at FirebaseOptions, as seen in my code below.



        FileInputStream serviceAccount = new FileInputStream("WEB-INF/MyApp.json");

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://MyApp.firebaseio.com")
.build();

FirebaseApp.initializeApp(options);


Here's the error in full




java.lang.NoClassDefFoundError: Could not initialize class com.google.firebase.internal.FirebaseThreadManagers
at com.google.firebase.FirebaseOptions$Builder.(FirebaseOptions.java:147)
at com.example.name.myapplication.backend.MyServlet.doGet(MyServlet.java:55)
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.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirectedModuleRequest(DevAppServerModulesFilter.java:415)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:128)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at com.google.appengine.tools.development.JettyContainerService.forwardToServer(JettyContainerService.java:458)
at com.google.appengine.tools.development.Modules.forwardToInstance(Modules.java:372)
at com.google.appengine.tools.development.DelegatingModulesFilterHelper.forwardToInstance(DelegatingModulesFilterHelper.java:95)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doRedirect(DevAppServerModulesFilter.java:326)
at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:119)
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.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:511)
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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)




Here's my build.gradle for the backend



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
}
}

repositories {
jcenter();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.firebase:firebase-admin:5.5.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'


appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
}


Top level build file:



    buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}

allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}






java google-app-engine firebase firebase-realtime-database firebase-admin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 1 '17 at 14:27

























asked Nov 30 '17 at 19:55









PSLDev

275




275












  • You tagged this with both "android" and "google-app-engine". Seems like it should be one or the other, but not both. Are you using the firebase-admin SDK on GAE?
    – Doug Stevenson
    Nov 30 '17 at 20:02










  • Sorry, yes. I'm using Google App Engine as a backend for my Android app. This is solely to do with GAE. I am using Firebase-admin SDK. It's one of my dependencies alongside firebase-database and firebase-core.
    – PSLDev
    Nov 30 '17 at 20:06










  • I just tested your exact build.gradle, and it worked fine for me. My gut feeling is that having the android plugins in your project has left it in an inconsistent state. I would recommend cleaning the project directory (gradle clean), and try to re-execute the app.
    – Hiranya Jayathilaka
    Nov 30 '17 at 22:09












  • I've tried that and no difference. Gradle builds fine but when the Servlet is called I get that error. Please see my edit for another error I sometimes see, occurs at the same line - Firebase options.
    – PSLDev
    Dec 1 '17 at 0:54










  • can you please post your toplevel buildfile?
    – Michael Meyer
    Dec 1 '17 at 10:07


















  • You tagged this with both "android" and "google-app-engine". Seems like it should be one or the other, but not both. Are you using the firebase-admin SDK on GAE?
    – Doug Stevenson
    Nov 30 '17 at 20:02










  • Sorry, yes. I'm using Google App Engine as a backend for my Android app. This is solely to do with GAE. I am using Firebase-admin SDK. It's one of my dependencies alongside firebase-database and firebase-core.
    – PSLDev
    Nov 30 '17 at 20:06










  • I just tested your exact build.gradle, and it worked fine for me. My gut feeling is that having the android plugins in your project has left it in an inconsistent state. I would recommend cleaning the project directory (gradle clean), and try to re-execute the app.
    – Hiranya Jayathilaka
    Nov 30 '17 at 22:09












  • I've tried that and no difference. Gradle builds fine but when the Servlet is called I get that error. Please see my edit for another error I sometimes see, occurs at the same line - Firebase options.
    – PSLDev
    Dec 1 '17 at 0:54










  • can you please post your toplevel buildfile?
    – Michael Meyer
    Dec 1 '17 at 10:07
















You tagged this with both "android" and "google-app-engine". Seems like it should be one or the other, but not both. Are you using the firebase-admin SDK on GAE?
– Doug Stevenson
Nov 30 '17 at 20:02




You tagged this with both "android" and "google-app-engine". Seems like it should be one or the other, but not both. Are you using the firebase-admin SDK on GAE?
– Doug Stevenson
Nov 30 '17 at 20:02












Sorry, yes. I'm using Google App Engine as a backend for my Android app. This is solely to do with GAE. I am using Firebase-admin SDK. It's one of my dependencies alongside firebase-database and firebase-core.
– PSLDev
Nov 30 '17 at 20:06




Sorry, yes. I'm using Google App Engine as a backend for my Android app. This is solely to do with GAE. I am using Firebase-admin SDK. It's one of my dependencies alongside firebase-database and firebase-core.
– PSLDev
Nov 30 '17 at 20:06












I just tested your exact build.gradle, and it worked fine for me. My gut feeling is that having the android plugins in your project has left it in an inconsistent state. I would recommend cleaning the project directory (gradle clean), and try to re-execute the app.
– Hiranya Jayathilaka
Nov 30 '17 at 22:09






I just tested your exact build.gradle, and it worked fine for me. My gut feeling is that having the android plugins in your project has left it in an inconsistent state. I would recommend cleaning the project directory (gradle clean), and try to re-execute the app.
– Hiranya Jayathilaka
Nov 30 '17 at 22:09














I've tried that and no difference. Gradle builds fine but when the Servlet is called I get that error. Please see my edit for another error I sometimes see, occurs at the same line - Firebase options.
– PSLDev
Dec 1 '17 at 0:54




I've tried that and no difference. Gradle builds fine but when the Servlet is called I get that error. Please see my edit for another error I sometimes see, occurs at the same line - Firebase options.
– PSLDev
Dec 1 '17 at 0:54












can you please post your toplevel buildfile?
– Michael Meyer
Dec 1 '17 at 10:07




can you please post your toplevel buildfile?
– Michael Meyer
Dec 1 '17 at 10:07












2 Answers
2






active

oldest

votes


















2














Don't use the firebase-admin dependency alongside the other Android client libraries in a server app. firebase-admin alone has everything you need to access Realtime Database in a JVM runtime. The Android client libraries will be of no use in a server app because they require Android infrastructure.






share|improve this answer





















  • If I remove the other Firebase dependencies, I get the error "Error:Version: 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin". In my top level build file, I have "classpath 'com.google.gms:google-services:3.1.0'" under dependencies and "maven { url "maven.google.com" }" under repositories.
    – PSLDev
    Nov 30 '17 at 20:34










  • Also don't use the google-services plugin for non-Android gradle build.
    – Doug Stevenson
    Nov 30 '17 at 20:37










  • I've made those changes but it's still giving the same error, unfortunately
    – PSLDev
    Nov 30 '17 at 21:01










  • Which one, the error from your question, or the error from the gradle plugin?
    – Doug Stevenson
    Nov 30 '17 at 21:05










  • The error in my question
    – PSLDev
    Nov 30 '17 at 21:07



















0














I had the same error NoClassDefFoundError FirebaseThreadManagers regarding this line of code: private ThreadManager threadManager = FirebaseThreadManagers.DEFAULT_THREAD_MANAGER;



Solution



Rebuild the gradle file. After the gradle file rebuilt the Kotlin app ran as expected.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47581597%2fcould-not-initialize-class-firebasethreadmanagers-error-on-firebase%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Don't use the firebase-admin dependency alongside the other Android client libraries in a server app. firebase-admin alone has everything you need to access Realtime Database in a JVM runtime. The Android client libraries will be of no use in a server app because they require Android infrastructure.






    share|improve this answer





















    • If I remove the other Firebase dependencies, I get the error "Error:Version: 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin". In my top level build file, I have "classpath 'com.google.gms:google-services:3.1.0'" under dependencies and "maven { url "maven.google.com" }" under repositories.
      – PSLDev
      Nov 30 '17 at 20:34










    • Also don't use the google-services plugin for non-Android gradle build.
      – Doug Stevenson
      Nov 30 '17 at 20:37










    • I've made those changes but it's still giving the same error, unfortunately
      – PSLDev
      Nov 30 '17 at 21:01










    • Which one, the error from your question, or the error from the gradle plugin?
      – Doug Stevenson
      Nov 30 '17 at 21:05










    • The error in my question
      – PSLDev
      Nov 30 '17 at 21:07
















    2














    Don't use the firebase-admin dependency alongside the other Android client libraries in a server app. firebase-admin alone has everything you need to access Realtime Database in a JVM runtime. The Android client libraries will be of no use in a server app because they require Android infrastructure.






    share|improve this answer





















    • If I remove the other Firebase dependencies, I get the error "Error:Version: 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin". In my top level build file, I have "classpath 'com.google.gms:google-services:3.1.0'" under dependencies and "maven { url "maven.google.com" }" under repositories.
      – PSLDev
      Nov 30 '17 at 20:34










    • Also don't use the google-services plugin for non-Android gradle build.
      – Doug Stevenson
      Nov 30 '17 at 20:37










    • I've made those changes but it's still giving the same error, unfortunately
      – PSLDev
      Nov 30 '17 at 21:01










    • Which one, the error from your question, or the error from the gradle plugin?
      – Doug Stevenson
      Nov 30 '17 at 21:05










    • The error in my question
      – PSLDev
      Nov 30 '17 at 21:07














    2












    2








    2






    Don't use the firebase-admin dependency alongside the other Android client libraries in a server app. firebase-admin alone has everything you need to access Realtime Database in a JVM runtime. The Android client libraries will be of no use in a server app because they require Android infrastructure.






    share|improve this answer












    Don't use the firebase-admin dependency alongside the other Android client libraries in a server app. firebase-admin alone has everything you need to access Realtime Database in a JVM runtime. The Android client libraries will be of no use in a server app because they require Android infrastructure.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 30 '17 at 20:11









    Doug Stevenson

    70.8k881101




    70.8k881101












    • If I remove the other Firebase dependencies, I get the error "Error:Version: 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin". In my top level build file, I have "classpath 'com.google.gms:google-services:3.1.0'" under dependencies and "maven { url "maven.google.com" }" under repositories.
      – PSLDev
      Nov 30 '17 at 20:34










    • Also don't use the google-services plugin for non-Android gradle build.
      – Doug Stevenson
      Nov 30 '17 at 20:37










    • I've made those changes but it's still giving the same error, unfortunately
      – PSLDev
      Nov 30 '17 at 21:01










    • Which one, the error from your question, or the error from the gradle plugin?
      – Doug Stevenson
      Nov 30 '17 at 21:05










    • The error in my question
      – PSLDev
      Nov 30 '17 at 21:07


















    • If I remove the other Firebase dependencies, I get the error "Error:Version: 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin". In my top level build file, I have "classpath 'com.google.gms:google-services:3.1.0'" under dependencies and "maven { url "maven.google.com" }" under repositories.
      – PSLDev
      Nov 30 '17 at 20:34










    • Also don't use the google-services plugin for non-Android gradle build.
      – Doug Stevenson
      Nov 30 '17 at 20:37










    • I've made those changes but it's still giving the same error, unfortunately
      – PSLDev
      Nov 30 '17 at 21:01










    • Which one, the error from your question, or the error from the gradle plugin?
      – Doug Stevenson
      Nov 30 '17 at 21:05










    • The error in my question
      – PSLDev
      Nov 30 '17 at 21:07
















    If I remove the other Firebase dependencies, I get the error "Error:Version: 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin". In my top level build file, I have "classpath 'com.google.gms:google-services:3.1.0'" under dependencies and "maven { url "maven.google.com" }" under repositories.
    – PSLDev
    Nov 30 '17 at 20:34




    If I remove the other Firebase dependencies, I get the error "Error:Version: 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin". In my top level build file, I have "classpath 'com.google.gms:google-services:3.1.0'" under dependencies and "maven { url "maven.google.com" }" under repositories.
    – PSLDev
    Nov 30 '17 at 20:34












    Also don't use the google-services plugin for non-Android gradle build.
    – Doug Stevenson
    Nov 30 '17 at 20:37




    Also don't use the google-services plugin for non-Android gradle build.
    – Doug Stevenson
    Nov 30 '17 at 20:37












    I've made those changes but it's still giving the same error, unfortunately
    – PSLDev
    Nov 30 '17 at 21:01




    I've made those changes but it's still giving the same error, unfortunately
    – PSLDev
    Nov 30 '17 at 21:01












    Which one, the error from your question, or the error from the gradle plugin?
    – Doug Stevenson
    Nov 30 '17 at 21:05




    Which one, the error from your question, or the error from the gradle plugin?
    – Doug Stevenson
    Nov 30 '17 at 21:05












    The error in my question
    – PSLDev
    Nov 30 '17 at 21:07




    The error in my question
    – PSLDev
    Nov 30 '17 at 21:07













    0














    I had the same error NoClassDefFoundError FirebaseThreadManagers regarding this line of code: private ThreadManager threadManager = FirebaseThreadManagers.DEFAULT_THREAD_MANAGER;



    Solution



    Rebuild the gradle file. After the gradle file rebuilt the Kotlin app ran as expected.






    share|improve this answer


























      0














      I had the same error NoClassDefFoundError FirebaseThreadManagers regarding this line of code: private ThreadManager threadManager = FirebaseThreadManagers.DEFAULT_THREAD_MANAGER;



      Solution



      Rebuild the gradle file. After the gradle file rebuilt the Kotlin app ran as expected.






      share|improve this answer
























        0












        0








        0






        I had the same error NoClassDefFoundError FirebaseThreadManagers regarding this line of code: private ThreadManager threadManager = FirebaseThreadManagers.DEFAULT_THREAD_MANAGER;



        Solution



        Rebuild the gradle file. After the gradle file rebuilt the Kotlin app ran as expected.






        share|improve this answer












        I had the same error NoClassDefFoundError FirebaseThreadManagers regarding this line of code: private ThreadManager threadManager = FirebaseThreadManagers.DEFAULT_THREAD_MANAGER;



        Solution



        Rebuild the gradle file. After the gradle file rebuilt the Kotlin app ran as expected.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 '18 at 16:48









        Adam Hurwitz

        9321027




        9321027






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47581597%2fcould-not-initialize-class-firebasethreadmanagers-error-on-firebase%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python