java.lang.NullPointerException

Hibernate JIRA | adam | 6 months ago
  1. 0

    We upgraded from 5.1 to 5.2 and started getting exceptions in some of our HQL queries. We currently use the SessionManager managed through Spring (as opposed to the EntityManager). h5. HQL Query: {code} String QUERY_HQL_MANY_TO_ONE_REFERENCES = "from InformationResource r1 where r1.publisher.id in (:idlist)"; {code} h5. NamedParameterSpecification.java with comments: {code} // name is "idlist" TypedValue typedValue = qp.getNamedParameters().get( name ); // typedValue is NULL typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); {code} h5. Exception: {code} java.lang.NullPointerException at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:53) at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:628) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1949) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1902) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1880) at org.hibernate.loader.Loader.scroll(Loader.java:2684) at org.hibernate.loader.hql.QueryLoader.scroll(QueryLoader.java:571) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.scroll(QueryTranslatorImpl.java:423) at org.hibernate.engine.query.spi.HQLQueryPlan.performScroll(HQLQueryPlan.java:350) at org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1543) at org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1310) at org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1300) at org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:99) at org.tdar.core.dao.ReflectionDao.findReferrers(ReflectionDao.java:60) {code} h5. Base Classes {code} @Entity @Table(name = "resource") @Inheritance(strategy = InheritanceType.JOINED) public class Resource { @Id private Long id = -1L; public Long getId() { return id; } public void setId(Long id) { this.id = id; } } ------ public abstract class InformationResource extends Resource { @ManyToOne(optional = true, cascade = { CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE, CascadeType.DETACH }) private Institution publisher; public Institution getPublisher() { return publisher; } public void setPublisher(Institution publisher) { this.publisher = publisher; } } public class Institution { @Id private Long id = -1L; public Long getId() { return id; } public void setId(Long id) { this.id = id; } } public class Document extends InformationResource { ... } {code}

    Hibernate JIRA | 6 months ago | adam
    java.lang.NullPointerException
  2. 0

    We upgraded from 5.1 to 5.2 and started getting exceptions in some of our HQL queries. We currently use the SessionManager managed through Spring (as opposed to the EntityManager). h5. HQL Query: {code} String QUERY_HQL_MANY_TO_ONE_REFERENCES = "from InformationResource r1 where r1.publisher.id in (:idlist)"; {code} h5. NamedParameterSpecification.java with comments: {code} // name is "idlist" TypedValue typedValue = qp.getNamedParameters().get( name ); // typedValue is NULL typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); {code} h5. Exception: {code} java.lang.NullPointerException at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:53) at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:628) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1949) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1902) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1880) at org.hibernate.loader.Loader.scroll(Loader.java:2684) at org.hibernate.loader.hql.QueryLoader.scroll(QueryLoader.java:571) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.scroll(QueryTranslatorImpl.java:423) at org.hibernate.engine.query.spi.HQLQueryPlan.performScroll(HQLQueryPlan.java:350) at org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1543) at org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1310) at org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1300) at org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:99) at org.tdar.core.dao.ReflectionDao.findReferrers(ReflectionDao.java:60) {code} h5. Base Classes {code} @Entity @Table(name = "resource") @Inheritance(strategy = InheritanceType.JOINED) public class Resource { @Id private Long id = -1L; public Long getId() { return id; } public void setId(Long id) { this.id = id; } } ------ public abstract class InformationResource extends Resource { @ManyToOne(optional = true, cascade = { CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE, CascadeType.DETACH }) private Institution publisher; public Institution getPublisher() { return publisher; } public void setPublisher(Institution publisher) { this.publisher = publisher; } } public class Institution { @Id private Long id = -1L; public Long getId() { return id; } public void setId(Long id) { this.id = id; } } public class Document extends InformationResource { ... } {code}

    Hibernate JIRA | 6 months ago | adam
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.param.NamedParameterSpecification.bind()
    2. Hibernate
      SessionImpl.scroll
      1. org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:53)
      2. org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:628)
      3. org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1949)
      4. org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1902)
      5. org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1880)
      6. org.hibernate.loader.Loader.scroll(Loader.java:2684)
      7. org.hibernate.loader.hql.QueryLoader.scroll(QueryLoader.java:571)
      8. org.hibernate.hql.internal.ast.QueryTranslatorImpl.scroll(QueryTranslatorImpl.java:423)
      9. org.hibernate.engine.query.spi.HQLQueryPlan.performScroll(HQLQueryPlan.java:350)
      10. org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1543)
      10 frames
    3. org.hibernate.query
      AbstractProducedQuery.scroll
      1. org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1310)
      2. org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1300)
      3. org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:99)
      3 frames
    4. org.tdar.core
      ReflectionDao.findReferrers
      1. org.tdar.core.dao.ReflectionDao.findReferrers(ReflectionDao.java:60)
      1 frame