Carstore example fails with: Error injecting constructor, java.lang.NullPointerException: No API environment is registered for this thread.

242 views
Skip to first unread message

LeastSignificantBit

unread,
Nov 27, 2018, 9:05:10 AM11/27/18
to GWTP
I try to start the car store example but i'm experiencing server errors when starting in Super Dev Mode.
Can someone help me?

Starting Jetty on port 9991
   [WARN] ServletContainerInitializers: detected. Class hierarchy: empty
   [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@199ca622{/,file:/Users/ben/Library/Caches/IntelliJIdea2018.1/gwt/carstore.6cbc1f48/carstore.e274574e/run/www/,STARTING}{/Users/ben/Library/Caches/IntelliJIdea2018.1/gwt/carstore.6cbc1f48/carstore.e274574e/run/www}
com.google.inject.CreationException: Guice creation errors:

1) Error injecting constructor, java.lang.NullPointerException: No API environment is registered for this thread.
  at com.gwtplatform.carstore.server.DevBootStrapper.<init>(DevBootStrapper.java:56)
  at com.gwtplatform.carstore.server.guice.ServerModule.configure(ServerModule.java:37)
  while locating com.gwtplatform.carstore.server.DevBootStrapper

1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:183)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at com.gwtplatform.carstore.server.guice.GuiceServletConfig.getInjector(GuiceServletConfig.java:26)
at com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:45)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:800)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:759)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:634)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
at com.google.gwt.dev.DevMode.main(DevMode.java:430)
Caused by: java.lang.NullPointerException: No API environment is registered for this thread.
at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:179)
at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace(DatastoreApiHelper.java:195)
at com.google.appengine.api.datastore.Query.<init>(Query.java:207)
at com.google.appengine.api.datastore.Query.<init>(Query.java:138)
at com.googlecode.objectify.impl.QueryImpl.<init>(QueryImpl.java:69)
at com.googlecode.objectify.impl.LoadTypeImpl.createQuery(LoadTypeImpl.java:49)
at com.googlecode.objectify.impl.Queryable.list(Queryable.java:55)
at com.gwtplatform.carstore.server.dao.BaseDao.getAll(BaseDao.java:41)
at com.gwtplatform.carstore.server.dao.BaseDao.deleteAll(BaseDao.java:92)
at com.gwtplatform.carstore.server.DevBootStrapper.deleteAllEntities(DevBootStrapper.java:85)
at com.gwtplatform.carstore.server.DevBootStrapper.init(DevBootStrapper.java:73)
at com.gwtplatform.carstore.server.DevBootStrapper.access$000(DevBootStrapper.java:41)
at com.gwtplatform.carstore.server.DevBootStrapper$1.vrun(DevBootStrapper.java:67)
at com.googlecode.objectify.VoidWork.run(VoidWork.java:14)
at com.googlecode.objectify.VoidWork.run(VoidWork.java:11)
at com.googlecode.objectify.ObjectifyService.run(ObjectifyService.java:81)
at com.gwtplatform.carstore.server.DevBootStrapper.<init>(DevBootStrapper.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:85)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:204)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:198)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:198)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:179)
... 32 more

LeastSignificantBit

unread,
Nov 27, 2018, 9:39:27 AM11/27/18
to GWTP

I forgot to put the following in my .m2/settings.xml

<server>
                <id>appengine-credentials</id>
                <username>admin</username>
                <password>qwerty</password>
</server>
Reply all
Reply to author
Forward
0 new messages