Announcement Announcement Module
Collapse
No announcement yet.
GAE Persistence: No API environment is registered for this thread. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GAE Persistence: No API environment is registered for this thread.

    I finally recovered from my hard drive failure and am back at trying to get GAE Persistence to work with my model.

    Now using STS 2.6.0 Roo 1.1.2

    I'm to the point where the application starts and the Home is displayed in the browser, but every data access action results in the same exception:

    No API environment is registered for this thread.

    How do I fix this?

    Thanks
    Dan

    the trace:

    Code:
    com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:108)
    com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace(DatastoreApiHelper.java:118)
    com.google.appengine.api.datastore.Query.<init>(Query.java:112)
    org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuery.java:649)
    org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:215)
    org.datanucleus.store.appengine.query.JPQLQuery.performExecute(JPQLQuery.java:77)
    org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
    org.datanucleus.store.query.Query.executeWithMap(Query.java:1398)
    org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:163)
    com.getrolling.cis.server.domain.Region_Roo_Entity.findAllRegions_aroundBody4(Region_Roo_Entity.aj:106)
    com.getrolling.cis.server.domain.Region_Roo_Entity.ajc$interMethod$com_getrolling_cis_server_domain_Region_Roo_Entity$com_getrolling_cis_server_domain_Region$findAllRegions(Region_Roo_Entity.aj:1)
    com.getrolling.cis.server.domain.Region.findAllRegions(Region.java:1)
    com.getrolling.cis.server.domain.Region_Roo_Entity.ajc$interMethodDispatch1$com_getrolling_cis_server_domain_Region_Roo_Entity$com_getrolling_cis_server_domain_Region$findAllRegions(Region_Roo_Entity.aj)
    com.getrolling.cis.web.RegionController_Roo_Controller.ajc$interMethod$com_getrolling_cis_web_RegionController_Roo_Controller$com_getrolling_cis_web_RegionController$populateRegions(RegionController_Roo_Controller.aj:91)
    com.getrolling.cis.web.RegionController.populateRegions(RegionController.java:1)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:162)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534)
    org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1351)
    org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
    org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473)
    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516)
    org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
    org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
    org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
    org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
    org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
    org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151)
    org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
    org.eclipse.jetty.server.Server.handle(Server.java:352)
    org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
    org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051)
    org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:590)
    org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212)
    org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
    org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508)
    org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
    org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
    org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
    java.lang.Thread.run(Thread.java:662)

  • #2
    Start as Web Application

    Dan,

    I was getting the same error until I realized I had to start the app by doing Run As | Web Application instead of Run As | Run on Server

    (The app launches fine in the tcServer, but fails on data operation because the GAE environment is not present).

    Hope that helps.

    Comment


    • #3
      Problem is this is not a GWT app. GAE only. Unless I'm missing something you only get the Run As | Web Application option if the project is GWT.

      Comment


      • #4
        No, mine wasn't a GWT app either, just GAE.

        Comment


        • #5
          Interesting. That run option does not show up for me. Anything special I need to do? I create the app with a ROO script and imported it into Eclipse.

          Comment


          • #6
            I created a Roo project in STS, so should be the same.

            At some point I went to project properties, under Google | App Engine and checked off the 'Use Google App Engine' checkbox.

            You might have to configure a GAE SDK in that page just by pointing to the jar already in the maven repository, IDK if it was put there by Eclipse plugin, or by roo when I selected GOOGLE_APP_ENGINE as the database engine when setting up persistence. Of course you can always download directly from Google and put it wherever you want.

            Comment

            Working...
            X