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 4055978
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:46:09+00:00 2026-05-20T14:46:09+00:00

I am getting this error when running junit test Testcase: testGet_User(Authentication.UserManagerTest): Caused an ERROR

  • 0

I am getting this error when running junit test

Testcase: testGet_User(Authentication.UserManagerTest):        Caused an ERROR
null
java.lang.NullPointerException
        at org.datanucleus.store.appengine.query.DatastoreQuery.getMappingForFieldWithName(DatastoreQuery.java:1307)
        at org.datanucleus.store.appengine.query.DatastoreQuery.addLeftPrimaryExpression(DatastoreQuery.java:1107)
        at org.datanucleus.store.appengine.query.DatastoreQuery.addExpression(DatastoreQuery.java:871)
        at org.datanucleus.store.appengine.query.DatastoreQuery.addFilters(DatastoreQuery.java:832)
        at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:230)
        at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:89)
        at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
        at org.datanucleus.store.query.Query.executeWithArray(Query.java:1371)
        at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:243)
        at Authentication.UserManager.get(UserManager.java:86)
        at Authentication.UserManagerTest.testGet_User(UserManagerTest.java:110)

code for get is:

public static UserBean get(User user) {
    PersistenceManager pm = PMF.get();

    // get user with id
    Query query = pm.newQuery(UserCommon.class);
    query.setFilter("id == idParam");
    query.declareParameters("String idParam");
    System.out.println("\t\tID:" + user.getUserId());
    List<UserCommon> userDatas = (List<UserCommon>) query.execute(user.getUserId());

Where I have persistent classes that looks :

@PersistenceCapable(detachable="true")
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public abstract class UserCommon {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private String id;

and

@PersistenceCapable(detachable="true")
public class Professor extends UserCommon {

and

@PersistenceCapable(detachable="true")
public class Student extends UserCommon {

basically, I’d like to have 2 types of users.
but while logging in, only information I have is their id.
Hence, I was trying to query on base class instead of either Professor or Student.
However, I got NullPointerException.

any suggestions to where I’ve made a mistake ?

Thanks in advance !

  • 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-05-20T14:46:09+00:00Added an answer on May 20, 2026 at 2:46 pm

    App Engine JDO has limited support for inheritance, and no polymorphic support http://code.google.com/appengine/docs/java/datastore/jdo/relationships.html#Polymorphic_Relationships
    this includes queries.

    Personally I would suggest using some other persistence wrapper rather than JDO such as http://code.google.com/p/objectify-appengine/ and http://code.google.com/p/twig-persist/
    which do a better job using the advantages of GAE.

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

Sidebar

Related Questions

I am getting this error when running ./manage.py migrate app_name While loading migration 'whatever.0001_initial':
I'm getting this error when running an SSIS package through SQL Agent Failed to
I am getting this error while running my app on the device.I have installed
I am getting this R6034 error when running program that I just updated (and
Anyone getting this error when using the new free chart controls MS bought from
I am getting this error now that I hit version number 1.256.0: Error 4
I am getting this error when trying to run internet information services on a
I am getting this error but only very occasionally. 99.9% of the time it
I'm getting this error on a compact framework form. code generation for property 'inputControl'
I'm getting this error message on all projects (including brand new empty templates) I'm

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.