The Nullpointer exception is thrown when using the getResultList () method in Kundera

I am using Kundera as JPA with HBase and java. Following is the method which call getResultList() method:

    public List<Activity> getAllActivities()
        em = emf.createEntityManager();
        Query q = em.createQuery("select ac from Activity ac");
        List<Activity> activities = q.getResultList();
        return activities;

It throws nullpointer exception.

Exception in thread "main" java.lang.NullPointerException
    at com.impetus.kundera.query.LuceneQuery.getResultList(
    at com.impetus.activity.dao.ActivityService.getAllActivities(
    at ActivityExample.main(

P.S : Activity table in HBase has 6 records.

What can be the reason for it?

Please try to add a property mentioned below

<property name="index_home_dir" value="./lucene" />

in persistence.xml.

Reason is your there is no default indexing support available with HBase.

It should work for you.