-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: NullPointerException while executing posted task
PostPosted: Mon May 02, 2005 4:50 am 
Newbie

Joined: Mon May 02, 2005 4:29 am
Posts: 5
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate 2/b]

[b]Mapping documents:




String sql = "from Product where ownRelease != 1 and amount != 0 order by instockdate asc";

Collection products = find(sql);

closeSession();


Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main] - caught unexpected Exception while executing posted taskjava.lang.NullPointerException at com.mysql.jdbc.ServerPreparedStatement.realClose(ServerPreparedStatement.java:1092) at com.mchange.v1.db.sql.StatementUtils.attemptClose(StatementUtils.java:711) at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1.run(GooGooStatementCache.java:38) at com.mchange.v2.async.stmt.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)

mysql-4.1.8

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Hello all,

i have a struts application in which i use hibernate together with a mysql database. Everything works great, BUT i keep getting the following exception in the tomcat 5.0.28 console :



code:
--------------------------------------------------------------------------------

Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main] - caught unexpected Exception while executing posted taskjava.lang.NullPointerException at com.mysql.jdbc.ServerPreparedStatement.realClose(ServerPreparedStatement.java:1092) at com.mchange.v1.db.sql.StatementUtils.attemptClose(StatementUtils.java:711) at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1.run(GooGooStatementCache.java:38) at com.mchange.v2.async.stmt.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)

--------------------------------------------------------------------------------



Does anyone have an idea how to solve this issue?

Thanks a lot!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 4:34 am 
C3P0 Developer
C3P0 Developer

Joined: Tue Jan 06, 2004 8:58 pm
Posts: 145
Hi. There are two issues here:

1) Perhaps you don't like where the messages are going, i.e. to Tomcat console. If this is the issue, upgrade to c3p0-0.9.0-pre5, which will log to log4j or jdk14logging.

2) Perhaps you don't like that Exceptions keep occuring in your application. Though I don't know for sure (and including more config information in your question would have helped), here is what I think is going on: Your pool, for whatever reason, decides to close and discard a Connection. The Connection has cached Statements associated with it. At Connection close, tasks are posted nearly simultaneously to asynchronously close all cached Statements belonging to the Connection as well as the Connection itself. BUT, some drivers are a bit buggy, and can't handle the unusual ordering where a Connection and its child Statement are closed simultaneously, or in an unusual order. When a Statement tries to close() after its parent Connection has already closed, your JDBC driver throws a NullPointerException. (Oracle seems also to have a problem -- an occasional deadlock -- with the simultaneous close of a Connection and its child Statements.

I've implemented a change in the Statement pooling to ensure all cached Statements close prior to the call to Connection close(), which should resolve these problems. This change isn't yet in any public release, because I'd like to test it a bit more. If you'd like to try a development version with the change, write me directly (swaldman@mchange.com), and I'll send you a development snapshot, which should, if I'm right about the problem, prevent these Exceptions from occurring at all.

smiles,
Steve (c3p0 guy)


Top
 Profile  
 
 Post subject: Re: NullPointerException while executing posted task
PostPosted: Tue Dec 10, 2013 5:23 am 
Newbie

Joined: Tue Dec 10, 2013 5:13 am
Posts: 1
Hi,

I am getting following exceptions.

Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#5" java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-8080-150" java.lang.NullPointerException
Exception in thread "http-8080-148" at java.util.concurrent.ConcurrentLinkedQueue.offer(ConcurrentLinkedQueue.java:273)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:537)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:554)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:618)
Exception in thread "http-8080-149" at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
java.lang.NullPointerException
at java.util.concurrent.ConcurrentLinkedQueue.offer(ConcurrentLinkedQueue.java:273)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:537)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:554)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:618)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
java.lang.NullPointerException
at java.util.concurrent.ConcurrentLinkedQueue.offer(ConcurrentLinkedQueue.java:273)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:537)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:554)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:618)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Nov 26, 2013 19:26:57 -0500 NewRelic 7 WARN: Unexpected exception detecting dead threads: java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-8080-178" java.lang.NullPointerException
at java.util.concurrent.ConcurrentLinkedQueue.offer(ConcurrentLinkedQueue.java:273)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:537)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:554)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:618)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Exception in thread "http-8080-179" java.lang.NullPointerException
at java.util.concurrent.ConcurrentLinkedQueue.offer(ConcurrentLinkedQueue.java:273)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:537)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler$1.offer(Http11Protocol.java:554)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:618)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)


First line Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#5" java.lang.OutOfMemoryError: Java heap space, which further produce NullPointerexception. I am using postgres9.2 database. Is this also related to c3p0. How can we overcome this. Please provide your feedback as these are production issues.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.