java.lang.NullPointerException

Hibernate JIRA | Scott Feldstein | 8 years ago
  1. 0

    A NullPointerException is thrown when hibernate.show_sql=true && hibernate.format_sql=true while exec'ing sql with quotes around the stmt: (taken from an embedded groovy script) --------- def sess = getSession() def HQL = """ (select count(*) from TABLE) """ sess .createSQLQuery(HQL) .list() ------------ This is valid SQL and is typically used in my app as such: (select count(*) from TABLE1) UNION ALL (select count(*) from TABLE2) ... Here is the stack trace in hibernate: java.lang.NullPointerException at org.hibernate.pretty.Formatter.isFunctionName(Formatter.java:342) at org.hibernate.pretty.Formatter.openParen(Formatter.java:323) at org.hibernate.pretty.Formatter.format(Formatter.java:134) at org.hibernate.jdbc.AbstractBatcher.format(AbstractBatcher.java:410) at org.hibernate.jdbc.AbstractBatcher.log(AbstractBatcher.java:404) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:482) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547) at org.hibernate.loader.Loader.doQuery(Loader.java:673) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)

    Hibernate JIRA | 8 years ago | Scott Feldstein
    java.lang.NullPointerException
  2. 0

    A NullPointerException is thrown when hibernate.show_sql=true && hibernate.format_sql=true while exec'ing sql with quotes around the stmt: (taken from an embedded groovy script) --------- def sess = getSession() def HQL = """ (select count(*) from TABLE) """ sess .createSQLQuery(HQL) .list() ------------ This is valid SQL and is typically used in my app as such: (select count(*) from TABLE1) UNION ALL (select count(*) from TABLE2) ... Here is the stack trace in hibernate: java.lang.NullPointerException at org.hibernate.pretty.Formatter.isFunctionName(Formatter.java:342) at org.hibernate.pretty.Formatter.openParen(Formatter.java:323) at org.hibernate.pretty.Formatter.format(Formatter.java:134) at org.hibernate.jdbc.AbstractBatcher.format(AbstractBatcher.java:410) at org.hibernate.jdbc.AbstractBatcher.log(AbstractBatcher.java:404) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:482) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547) at org.hibernate.loader.Loader.doQuery(Loader.java:673) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)

    Hibernate JIRA | 8 years ago | Scott Feldstein
    java.lang.NullPointerException
  3. 0

    Hibernate NullPointerException In Loader Class

    Stack Overflow | 7 years ago | SteveT
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate ehCache null pointer exception on put

    Stack Overflow | 5 years ago | kgibbon
    java.lang.NullPointerException

    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.pretty.Formatter.isFunctionName()
    2. Hibernate
      CustomLoader.list
      1. org.hibernate.pretty.Formatter.isFunctionName(Formatter.java:342)
      2. org.hibernate.pretty.Formatter.openParen(Formatter.java:323)
      3. org.hibernate.pretty.Formatter.format(Formatter.java:134)
      4. org.hibernate.jdbc.AbstractBatcher.format(AbstractBatcher.java:410)
      5. org.hibernate.jdbc.AbstractBatcher.log(AbstractBatcher.java:404)
      6. org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:482)
      7. org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
      8. org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
      9. org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
      10. org.hibernate.loader.Loader.doQuery(Loader.java:673)
      11. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      12. org.hibernate.loader.Loader.doList(Loader.java:2220)
      13. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
      14. org.hibernate.loader.Loader.list(Loader.java:2099)
      15. org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
      15 frames
    3. Hibernate
      SQLQueryImpl.list
      1. org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
      2. org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
      3. org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
      3 frames