Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8120867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:17:32+00:00 2026-06-06T05:17:32+00:00

I am using Google App Engine, spring mvc and spring jpa dao. In my

  • 0

I am using Google App Engine, spring mvc and spring jpa dao. In my application i want to delete an entry from the database when session is destroyed. So i am using session listeners which actually wants to deletes an entry from the database through spring dao bean.

Here is my code in session listener

@Override
public void sessionDestroyed(HttpSessionEvent se) {
//get entry from session and now remove entry from database
getMyDao(se).delete(entry);
}

private MyDao getMyDao(HttpSessionEvent sessionEvent){

     HttpSession session = sessionEvent.getSession();

    ApplicationContext ctx = 
          WebApplicationContextUtils.
                getWebApplicationContext(session.getServletContext());

    MyDao dao = 
                (MyDao) ctx.getBean("myDao");

    return dao;
}

I am getting the below error when i try deleting

java.lang.NullPointerException: No API environment is registered for this thread.
at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:108)
at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace(DatastoreApiHelper.java:118)
at com.google.appengine.api.datastore.Query.(Query.java:112)
at org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuery.java:794)
at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:225)
at org.datanucleus.store.appengine.query.JPQLQuery.performExecute(JPQLQuery.java:80)

Can any one please tell me why api environment is not registered when i invoke from session listener?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:17:34+00:00Added an answer on June 6, 2026 at 5:17 am

    Google App Engine Doesn’t support session listeners. Session listeners may get invoke in local, but No API environment is registered for this thread. In production listeners will not even invoke.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are building an application on Google App Engine in Java using Spring 2.5.
I recently deployed a Spring MVC application to google app engine, and the intial
I want to upload one image to the database by using Google app engine
I am using Spring's MVC framework for an application I'm hosting on Google's App
I have a Google App Engine app using Java and Spring MVC 3.0. A
I'm using Google App Engine python. I want to know what browser the user
I am using Google App Engine to host my Facebook Application because it is
i'm trying to connect a desktop application in java to google app engine using
I'm using JPA with with Google App Engine. Let's say I have a very
I want to make a HTTP request using Google App Engine in Go to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.