java.lang.NullPointerException

Stack Overflow | Chandu Pandey | 4 months ago
  1. 0

    Hibernate NullPointerException on query.list()?

    Stack Overflow | 4 months ago | Chandu Pandey
    java.lang.NullPointerException
  2. 0

    Hibernate NullPointerException In Loader Class

    Stack Overflow | 7 years ago | SteveT
    java.lang.NullPointerException
  3. 0

    Hibernate ehCache null pointer exception on put

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

    Automated exception search integrated into your IDE

  5. 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

    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.loader.custom.CustomLoader$Metadata.<init>()
    2. Hibernate
      CustomLoader.list
      1. org.hibernate.loader.custom.CustomLoader$Metadata.<init>(CustomLoader.java:552)
      2. org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:525)
      3. org.hibernate.loader.Loader.getResultSet(Loader.java:1878)
      4. org.hibernate.loader.Loader.doQuery(Loader.java:718)
      5. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
      6. org.hibernate.loader.Loader.doList(Loader.java:2449)
      7. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192)
      8. org.hibernate.loader.Loader.list(Loader.java:2187)
      9. org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
      9 frames
    3. Hibernate
      SQLQueryImpl.list
      1. org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1832)
      2. org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
      3. org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:179)
      3 frames
    4. com.uil.dat
      WorkOrderControllerBean.calcPriority
      1. com.uil.dat.dao.impl.WorkOrderDAOImpl.calculatePriority(WorkOrderDAOImpl.java:60)
      2. com.uil.dat.manager.impl.DAOManagerImpl.calculatePriority(DAOManagerImpl.java:154)
      3. com.uil.dat.service.spt.impl.WorkOrderServiceImpl.calcPriority(WorkOrderServiceImpl.java:157)
      4. com.uil.dat.controller.spt.WorkOrderControllerBean.calcPriority(WorkOrderControllerBean.java:308)
      4 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      4. java.lang.reflect.Method.invoke(Method.java:611)
      4 frames
    6. Pax Jsp
      MethodExpressionImpl.invoke
      1. org.apache.el.parser.AstValue.invoke(AstValue.java:268)
      2. org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
      2 frames
    7. org.apache.myfaces
      TagMethodExpression.invoke
      1. org.apache.myfaces.view.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:83)
      1 frame
    8. JavaEE 7
      _MethodExpressionToMethodBinding.invoke
      1. javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:88)
      1 frame
    9. Impl
      ActionListenerImpl.processAction
      1. org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:100)
      1 frame
    10. JavaEE 7
      UIViewRoot.processApplication
      1. javax.faces.component.UICommand.broadcast(UICommand.java:120)
      2. javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:995)
      3. javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:278)
      4. javax.faces.component.UIViewRoot._process(UIViewRoot.java:1307)
      5. javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:733)
      5 frames
    11. Impl
      LifecycleImpl.execute
      1. org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:34)
      2. org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:172)
      3. org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:119)
      3 frames
    12. JavaEE 7
      FacesServlet.service
      1. javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
      1 frame
    13. WebSphere
      WebAppFilterChain.doFilter
      1. com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
      2. com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
      3. com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
      4. com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
      5. com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
      6. com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
      6 frames
    14. com.uil.dat
      RequestFilter.doFilter
      1. com.uil.dat.filter.RequestFilter.doFilter(RequestFilter.java:74)
      1 frame
    15. WebSphere
      WSWebContainer.handleRequest
      1. com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
      2. com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
      3. com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:964)
      4. com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1104)
      5. com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
      6. com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:914)
      7. com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
      7 frames
    16. com.ibm.ws
      WCChannelLink.ready
      1. com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
      1 frame
    17. WebSphere
      AioReadCompletionListener.futureCompleted
      1. com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
      2. com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
      3. com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
      4. com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
      5. com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
      5 frames
    18. com.ibm.io
      ResultHandler$2.run
      1. com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      2. com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      3. com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
      4. com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
      5. com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
      6. com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
      6 frames
    19. com.ibm.ws
      ThreadPool$Worker.run
      1. com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1865)
      1 frame