Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Hibernate - NullPointerException : PreparedStatement.java:1709

  1. #1
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,357
    My Mood
    Hungover
    Thanks
    144
    Thanked 626 Times in 537 Posts

    Question Hibernate - NullPointerException : PreparedStatement.java:1709

    I originally posted this question here last week, but I haven't received any responses, so I'm hoping to get some feedback here- if even just to find out what else I need to post in order to get an answer.

    Anyway, I'm still pretty new to Hibernate, but I'm using it behind my website, StaticVoidGames.com.

    Everything works great most of the time. I've had hundreds of users over the course of a week or so, as well as periods when I'm the only one doing anything. And it works great for days at a time. But seemingly randomly, the entire site goes down (I'm using AWS, so if the health check on the main page, which calls the below code, fails, then the whole site goes down). I finally tracked down the start of the downtime to this error, but unfortunately I have no idea what it means. And it doesn't happen often, just often enough that I have no idea when the site will go down next.

    The line in my jsp that eventually leads to the error is this: List<Game> games = HibernateApi.getAllGames();

    Which calls this simple method:

    public static List<Game> getAllGames(){
       List<Game> games = session.createQuery( "from Game" ).list();
       return games;
    }

    Which then leads to this stack trace:

    Jun 1, 2012 7:53:03 AM com.mchange.v2.c3p0.stmt.GooGooStatementCache assimilateNewCheckedOutStatement
    INFO: Multiply prepared statement! select game0_.gameName as gameName0_, game0_.appletClass as appletCl2_0_, game0_.appletDescription as appletDe3_0_, game0_.appletHeight as appletHe4_0_, game0_.appletWidth as appletWi5_0_, game0_.backgroundUrl as backgrou6_0_, game0_.faviconUrl as faviconUrl0_, game0_.gameDescription as gameDesc8_0_, game0_.jarFileUrl as jarFileUrl0_, game0_.javaVersion as javaVer10_0_, game0_.mainClass as mainClass0_, game0_.member as member0_, game0_.rating as rating0_, game0_.shortDescription as shortDe14_0_, game0_.sourceZipUrl as sourceZ15_0_, game0_.thumbnailUrl as thumbna16_0_, game0_.timestamp as timestamp0_, game0_.title as title0_, game0_.website as website0_, game0_.webstartHeight as webstar20_0_, game0_.webstartWidth as webstar21_0_ from Games game0_
    Jun 1, 2012 7:53:33 AM com.mchange.v2.c3p0.stmt.GooGooStatementCache assimilateNewCheckedOutStatement
    INFO: Multiply prepared statement! select game0_.gameName as gameName0_, game0_.appletClass as appletCl2_0_, game0_.appletDescription as appletDe3_0_, game0_.appletHeight as appletHe4_0_, game0_.appletWidth as appletWi5_0_, game0_.backgroundUrl as backgrou6_0_, game0_.faviconUrl as faviconUrl0_, game0_.gameDescription as gameDesc8_0_, game0_.jarFileUrl as jarFileUrl0_, game0_.javaVersion as javaVer10_0_, game0_.mainClass as mainClass0_, game0_.member as member0_, game0_.rating as rating0_, game0_.shortDescription as shortDe14_0_, game0_.sourceZipUrl as sourceZ15_0_, game0_.thumbnailUrl as thumbna16_0_, game0_.timestamp as timestamp0_, game0_.title as title0_, game0_.website as website0_, game0_.webstartHeight as webstar20_0_, game0_.webstartWidth as webstar21_0_ from Games game0_
    Jun 1, 2012 7:54:02 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [An exception occurred processing JSP page /index.jsp at line 16
     
    13:    else{
    14:       session.setAttribute("loginRedirect", request.getRequestURL().toString());
    15:    }
    16:    List<Game> games = HibernateApi.getAllGames();
    17:    
    18:    //update cookies for forum
    19:    if(session.getAttribute("user") != null){
     
     
    Stacktrace:] with root cause
    java.lang.NullPointerException
       at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1709)
       at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1685)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1396)
       at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
       at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:616)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
       at $Proxy10.executeQuery(Unknown Source)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1978)
       at org.hibernate.loader.Loader.doQuery(Loader.java:829)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
       at org.hibernate.loader.Loader.doList(Loader.java:2463)
       at org.hibernate.loader.Loader.doList(Loader.java:2449)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)
       at org.hibernate.loader.Loader.list(Loader.java:2274)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
       at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
       at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)
       at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115)
       at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
       at com.staticvoidgames.hibernateApi.HibernateApi.getAllGames(HibernateApi.java:114)
       at org.apache.jsp.index_jsp._jspService(index_jsp.java:93)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
       at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
       at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
       at java.lang.Thread.run(Thread.java:636)
    Jun 1, 2012 7:54:02 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [An exception occurred processing JSP page /index.jsp at line 16
     
    13:    else{
    14:       session.setAttribute("loginRedirect", request.getRequestURL().toString());
    15:    }
    16:    List<Game> games = HibernateApi.getAllGames();
    17:    
    18:    //update cookies for forum
    19:    if(session.getAttribute("user") != null){
     
     
    Stacktrace:] with root cause
    java.lang.NullPointerException
       at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1709)
       at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1685)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1396)
       at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
       at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:616)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
       at $Proxy10.executeQuery(Unknown Source)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1978)
       at org.hibernate.loader.Loader.doQuery(Loader.java:829)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
       at org.hibernate.loader.Loader.doList(Loader.java:2463)
       at org.hibernate.loader.Loader.doList(Loader.java:2449)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)
       at org.hibernate.loader.Loader.list(Loader.java:2274)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
       at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
       at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)
       at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115)
       at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
       at com.staticvoidgames.hibernateApi.HibernateApi.getAllGames(HibernateApi.java:114)
       at org.apache.jsp.index_jsp._jspService(index_jsp.java:93)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
       at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
       at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
       at java.lang.Thread.run(Thread.java:636)
    Jun 1, 2012 7:54:02 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
    WARN: SQL Error: 0, SQLState: 08S01
    Jun 1, 2012 7:54:02 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
    ERROR: Communications link failure due to underlying exception:
     
    ** BEGIN NESTED EXCEPTION **
     
    java.io.EOFException
    MESSAGE: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
     
    STACKTRACE:
     
    java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
       at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
       at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2411)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
       at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
       at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1467)
       at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
       at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:616)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
       at $Proxy10.executeQuery(Unknown Source)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1978)
       at org.hibernate.loader.Loader.doQuery(Loader.java:829)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
       at org.hibernate.loader.Loader.doList(Loader.java:2463)
       at org.hibernate.loader.Loader.doList(Loader.java:2449)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)
       at org.hibernate.loader.Loader.list(Loader.java:2274)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
       at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
       at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)
       at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115)
       at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
       at com.staticvoidgames.hibernateApi.HibernateApi.getAllGames(HibernateApi.java:114)
       at org.apache.jsp.index_jsp._jspService(index_jsp.java:93)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
       at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
       at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
       at java.lang.Thread.run(Thread.java:636)
     
     
    ** END NESTED EXCEPTION **

    After that, the error repeats the following nonstop until I restart my app server. I've checked, and my database is still available, and had been available throughout the entire site downtime.

    Last packet sent to the server was 88943 ms ago.
    Jun 1, 2012 7:54:02 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [An exception occurred processing JSP page /index.jsp at line 16
     
    13:    else{
    14:       session.setAttribute("loginRedirect", request.getRequestURL().toString());
    15:    }
    16:    List<Game> games = HibernateApi.getAllGames();
    17:    
    18:    //update cookies for forum
    19:    if(session.getAttribute("user") != null){
     
     
    Stacktrace:] with root cause
    com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
     
    ** BEGIN NESTED EXCEPTION **
     
    java.io.EOFException
    MESSAGE: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
     
    STACKTRACE:
     
    java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
       at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
       at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2411)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
       at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
       at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1467)
       at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
       at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:616)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
       at $Proxy10.executeQuery(Unknown Source)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1978)
       at org.hibernate.loader.Loader.doQuery(Loader.java:829)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
       at org.hibernate.loader.Loader.doList(Loader.java:2463)
       at org.hibernate.loader.Loader.doList(Loader.java:2449)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)
       at org.hibernate.loader.Loader.list(Loader.java:2274)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
       at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
       at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)
       at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115)
       at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
       at com.staticvoidgames.hibernateApi.HibernateApi.getAllGames(HibernateApi.java:114)
       at org.apache.jsp.index_jsp._jspService(index_jsp.java:93)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
       at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
       at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
       at java.lang.Thread.run(Thread.java:636)
     
     
    ** END NESTED EXCEPTION **
     
     
     
    Last packet sent to the server was 88943 ms ago.
       at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2622)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
       at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
       at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1467)
       at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
       at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:616)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
       at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
       at $Proxy10.executeQuery(Unknown Source)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1978)
       at org.hibernate.loader.Loader.doQuery(Loader.java:829)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
       at org.hibernate.loader.Loader.doList(Loader.java:2463)
       at org.hibernate.loader.Loader.doList(Loader.java:2449)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)
       at org.hibernate.loader.Loader.list(Loader.java:2274)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
       at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
       at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)
       at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115)
       at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
       at com.staticvoidgames.hibernateApi.HibernateApi.getAllGames(HibernateApi.java:114)
       at org.apache.jsp.index_jsp._jspService(index_jsp.java:93)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
       at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
       at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
       at java.lang.Thread.run(Thread.java:636)
    Jun 1, 2012 7:54:02 AM org.apache.catalina.core.StandardHostValve throwable
    WARNING: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error.jsp]
    ClientAbortException:  java.net.SocketException: Broken pipe
       at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:336)
       at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:301)
       at org.apache.catalina.connector.Response.flushBuffer(Response.java:565)
       at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:401)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:191)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
       at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
       at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
       at java.lang.Thread.run(Thread.java:636)
    Caused by: java.net.SocketException: Broken pipe
       at java.net.SocketOutputStream.socketWrite0(Native Method)
       at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
       at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
       at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:216)
       at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:460)
       at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119)
       at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:781)
       at org.apache.coyote.Response.action(Response.java:170)
       at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:331)
       ... 15 more
    Jun 1, 2012 7:54:18 AM com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run
    WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@30acf575 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
    Jun 1, 2012 7:54:18 AM com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run
    WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@30acf575 -- APPARENT DEADLOCK!!! Complete Status:
       Managed Threads: 3
       Active Threads: 3
       Active Tasks:
          com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6b7467dc (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
          com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@274ed3a1 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
          com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@28280330 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
       Pending Tasks:
          com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5ae958e8
          com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask@dcc15f9
    Pool thread stack traces:
       Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
          java.net.PlainSocketImpl.socketConnect(Native Method)
          java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
          java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
          java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
          java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
          java.net.Socket.connect(Socket.java:546)
          java.net.Socket.connect(Socket.java:495)
          java.net.Socket.<init>(Socket.java:392)
          java.net.Socket.<init>(Socket.java:235)
          com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
          com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
          com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
          com.mysql.jdbc.Connection.<init>(Connection.java:1555)
          com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
          com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
          com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
          com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
          com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
          com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
          com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
          com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
       Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
          java.net.PlainSocketImpl.socketConnect(Native Method)
          java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
          java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
          java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
          java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
          java.net.Socket.connect(Socket.java:546)
          java.net.Socket.connect(Socket.java:495)
          java.net.Socket.<init>(Socket.java:392)
          java.net.Socket.<init>(Socket.java:235)
          com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
          com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
          com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
          com.mysql.jdbc.Connection.<init>(Connection.java:1555)
          com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
          com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
          com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
          com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
          com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
          com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
          com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
          com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
       Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
          java.net.PlainSocketImpl.socketConnect(Native Method)
          java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
          java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
          java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
          java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
          java.net.Socket.connect(Socket.java:546)
          java.net.Socket.connect(Socket.java:495)
          java.net.Socket.<init>(Socket.java:392)
          java.net.Socket.<init>(Socket.java:235)
          com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
          com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
          com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
          com.mysql.jdbc.Connection.<init>(Connection.java:1555)
          com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
          com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
          com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
          com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
          com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
          com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
          com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
          com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
     
     
    Jun 1, 2012 7:54:18 AM com.mchange.v2.c3p0.impl.NewPooledConnection handleThrowable
    WARNING: [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
    Jun 1, 2012 7:54:18 AM com.mchange.v2.c3p0.impl.NewPooledConnection handleThrowable
    WARNING: [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:

    I'd absolutely love any feedback on this, or a clue as to what's going on, or a way around it, or anything. Like I said this doesn't happen often, just often enough to be annoying.

    I'm still really new to Hibernate, databases, and web programming in general, so if there's any more information you need, let me know.

    Thanks for your time, and I appreciate any help you can give me.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,301
    Thanks
    181
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: Hibernate - NullPointerException : PreparedStatement.java:1709

    See MySQL Bugs: #41628: NullPointerException from Statement.execute() when closing from another thread

    I noticed you are using a static method to retrieve the list of games. My guess (and only a guess) is that you have threading issues. If configured in such a way as to use a single thread, I could envision a scenario in which two requests occur almost simultaneously, the first closes ConnectorJ resources while the other is trying to access and bang - the latter has the door slammed shut and you end up with resources that get out of sync (hence the perpetual message). Do you have thread pools set up to access the DB?
    Last edited by copeg; June 6th, 2012 at 12:44 PM.

  3. The Following User Says Thank You to copeg For This Useful Post:

    KevinWorkman (June 6th, 2012)

  4. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,357
    My Mood
    Hungover
    Thanks
    144
    Thanked 626 Times in 537 Posts

    Default Re: Hibernate - NullPointerException : PreparedStatement.java:1709

    Thanks for the reply. I made the database accessor methods static because I (perhaps incorrectly) guessed that it would simplify things over creating an instance for each database interaction.

    I think I have a default connection pool set up, using these settings in the hibernate config file:

    <!--c3p0 stuff-->
    <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
     
    <property name="hibernate.c3p0.min_size">5</property>
    <property name="hibernate.c3p0.max_size">20</property>
    <property name="hibernate.c3p0.timeout">150</property>
    <property name="hibernate.c3p0.idle_test_period">75</property>
    <property name="hibernate.c3p0.max_statements">50</property>

    To further confuse things, the forum on the website (forum.StaticVoidGames.com) is actually a separate web app, using these exact settings and accessing the same databse. But that has never gone down.

    I am pretty far out of my depth here, so I definitely appreciate any direction.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,301
    Thanks
    181
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: Hibernate - NullPointerException : PreparedStatement.java:1709

    Its been a long time since I used Hibernate, but if I remember correctly JDBC connections (and connection pools) are managed above the Session level. In other words, if you obtain a Session instance it is a single Connection to the database. Thus multiple threads accessing the same Session (as it appears your code above does) at the same time can run into concurrency issues. My advice would be to allow Hibernate to manage connections using its connection pool - I believe you do so through the SessionFactory class. So the above code would translate to something like:
    List<Game> games = mySessionFactory.openSession().createQuery( "from Game" ).list();

  6. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,357
    My Mood
    Hungover
    Thanks
    144
    Thanked 626 Times in 537 Posts

    Default Re: Hibernate - NullPointerException : PreparedStatement.java:1709

    Quote Originally Posted by copeg View Post
    Its been a long time since I used Hibernate, but if I remember correctly JDBC connections (and connection pools) are managed above the Session level. In other words, if you obtain a Session instance it is a single Connection to the database. Thus multiple threads accessing the same Session (as it appears your code above does) at the same time can run into concurrency issues. My advice would be to allow Hibernate to manage connections using its connection pool - I believe you do so through the SessionFactory class. So the above code would translate to something like:
    List<Game> games = mySessionFactory.openSession().createQuery( "from Game" ).list();
    That's interesting. Wouldn't I then want to close the session afterwards? I thought of doing something like this:

    public static List<Game> getAllGames(){	
    	Session session = sessionFactory.openSession();
    	List<Game> games = session.createQuery( "from Game" ).list();
    	session.close();
     
    	return games;
    }

    But that leads to other errors because of lazy loading, one of the side-effects of which being that Hibernate doesn't want you to use an Object after the Session that generated it has been closed. I thought of just disabling lazy loading entirely to get around that, but that doesn't seem like it should be the correct solution to the original problem I'm having.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #6
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,301
    Thanks
    181
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: Hibernate - NullPointerException : PreparedStatement.java:1709

    Yes you'd need to close the session...it sounds like some refactoring is in your future. If you truly want lazy loading from the Client/jsp page, then you'll need some way of closing the session. If you can survive without lazy loading then that's an easy solution (you could do this as a test, to see if refactoring is truly necessary). If not, you'll need a mechanism to close the session. This could be through a) relying on the client to close the session or b) creating different methods to access subsets of information and have the method encapsulate the session c) having the client tell the method what it needs and read the information in the getAllGames method and have the method encapsulate the session (for instance, deep copy the Game instances - and the client could tell the method what it needs by passing a bitwise flag to the method which in turn tell the deep copy method what values to copy). I've designed with the bitwise method often and it is extremely flexible to refactoring and the different needs of clients.

  8. The Following User Says Thank You to copeg For This Useful Post:

    KevinWorkman (June 7th, 2012)

  9. #7
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,357
    My Mood
    Hungover
    Thanks
    144
    Thanked 626 Times in 537 Posts

    Default Re: Hibernate - NullPointerException : PreparedStatement.java:1709

    Oh yeah, there is definitely quite a bit of refactoring in my near future.

    I think I'm going to look into using non-static instances of Session by opening up a Session before any database interaction, doing the database stuff with that Session instance, then closing it when it's done- that sounds trivially correct, but I've been dumbly using a single Session instance for everything, or trying to open up a new Session for every individual transaction instead of each logical group. In theory, this way I'll avoid the threading issue without giving up lazy loading.

    The problem now is that I haven't seen my original problem in about a week! So I won't really know I fixed anything! The joys of programming...

    Thanks again for your feedback, you got me thinking down the right track (or at least a better track). But if anybody has a more definitive (doubtful, since threading issues are usually pretty impossible to definitively nail down), I'm still all ears.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 0
    Last Post: January 12th, 2012, 06:00 AM
  2. Replies: 3
    Last Post: December 27th, 2011, 06:55 AM
  3. NullPointerException with java.io using a gui
    By killzone in forum What's Wrong With My Code?
    Replies: 4
    Last Post: July 18th, 2011, 05:07 PM
  4. [SOLVED] Java run time error: 'java.lang.NullPointerException"
    By ChandanSharma in forum What's Wrong With My Code?
    Replies: 9
    Last Post: June 20th, 2011, 11:53 AM
  5. All FAQs related Java/J2EE, Struts,Spring and Hibernate
    By sanchi21 in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: June 10th, 2011, 04:14 AM