java.lang.NullPointerException

Hibernate JIRA | Hakan Junior | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have an entity. It has the following field, {code} @Formula("adi||' '||soyadi") private String adiSoyadi; public String getAdiSoyadi() { return this.adiSoyadi; } //Tested with removing this also public void setAdiSoyadi(final String adiSoyadi) { this.adiSoyadi = adiSoyadi; } {code} If i include this column the Query raises below error; {code} java.lang.NullPointerException at org.hibernate.loader.DefaultEntityAliases.intern(DefaultEntityAliases.java:193) at org.hibernate.loader.DefaultEntityAliases.getSuffixedPropertyAliases(DefaultEntityAliases.java:151) at org.hibernate.loader.DefaultEntityAliases.determinePropertyAliases(DefaultEntityAliases.java:93) at org.hibernate.loader.DefaultEntityAliases.<init>(DefaultEntityAliases.java:65) at org.hibernate.loader.ColumnEntityAliases.<init>(ColumnEntityAliases.java:43) at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.generateCustomReturns(SQLQueryReturnProcessor.java:198) at org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:152) at org.hibernate.engine.query.spi.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:67) at org.hibernate.engine.query.spi.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:197) at org.hibernate.internal.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:223) at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:229) {code} If i remove the Formula it works. Please find attached debug screenshot.

    Hibernate JIRA | 5 years ago | Hakan Junior
    java.lang.NullPointerException
  2. 0

    I have an entity. It has the following field, {code} @Formula("adi||' '||soyadi") private String adiSoyadi; public String getAdiSoyadi() { return this.adiSoyadi; } //Tested with removing this also public void setAdiSoyadi(final String adiSoyadi) { this.adiSoyadi = adiSoyadi; } {code} If i include this column the Query raises below error; {code} java.lang.NullPointerException at org.hibernate.loader.DefaultEntityAliases.intern(DefaultEntityAliases.java:193) at org.hibernate.loader.DefaultEntityAliases.getSuffixedPropertyAliases(DefaultEntityAliases.java:151) at org.hibernate.loader.DefaultEntityAliases.determinePropertyAliases(DefaultEntityAliases.java:93) at org.hibernate.loader.DefaultEntityAliases.<init>(DefaultEntityAliases.java:65) at org.hibernate.loader.ColumnEntityAliases.<init>(ColumnEntityAliases.java:43) at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.generateCustomReturns(SQLQueryReturnProcessor.java:198) at org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:152) at org.hibernate.engine.query.spi.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:67) at org.hibernate.engine.query.spi.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:197) at org.hibernate.internal.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:223) at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:229) {code} If i remove the Formula it works. Please find attached debug screenshot.

    Hibernate JIRA | 5 years ago | Hakan Junior
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.loader.DefaultEntityAliases.intern()
    2. Hibernate
      AbstractSessionImpl.list
      1. org.hibernate.loader.DefaultEntityAliases.intern(DefaultEntityAliases.java:193)
      2. org.hibernate.loader.DefaultEntityAliases.getSuffixedPropertyAliases(DefaultEntityAliases.java:151)
      3. org.hibernate.loader.DefaultEntityAliases.determinePropertyAliases(DefaultEntityAliases.java:93)
      4. org.hibernate.loader.DefaultEntityAliases.<init>(DefaultEntityAliases.java:65)
      5. org.hibernate.loader.ColumnEntityAliases.<init>(ColumnEntityAliases.java:43)
      6. org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.generateCustomReturns(SQLQueryReturnProcessor.java:198)
      7. org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:152)
      8. org.hibernate.engine.query.spi.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:67)
      9. org.hibernate.engine.query.spi.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:197)
      10. org.hibernate.internal.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:223)
      11. org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:229)
      11 frames