I'm getting strange exceptions in Finalizer thread.
First this exception happens:
Daemon System Thread [Finalizer] (Suspended (exception
NullPointerException))
JdbcOdbcDriver.finalize() line: 96 [local variables unavailable]
Thread.run() line: 619
When I click in the stack on line "JdbcOdbcDriver.finalize() line: 96
[local variables unavailable]", Eclipse shows following variables:
this JdbcOdbcDriver (id=55)
iTimeOut 0
outWriter null
tracer JdbcOdbcTracer (id=61)
outWriter null
When I resume, immediately after first exception, second exception
happens:
Daemon System Thread [Finalizer] (Suspended (exception Error))
Session.finalize() line: 212 [local variables unavailable]
Thread.run() line: 619
Line number 212 in Session.java is this line:
throw Message.getInternalError("not closed", stackTrace);
But I can't see the stack trace and no exception appears in my
DefaultUncaughtExceptionsHandler, so I can't provide more information.
Does anyone have an idea if this is OK? I would love to provide more
information, but I don't know how.
I'm using the latest version of H2(1.0.79) and this happens *ONLY*
with JRockIt jrrt-3.0.0-1.6.0-windows-ia32.
The first exception is related to the JDBC-ODBC bridge that comes with the JDK. This is unrelated to H2. H2 doesn't use it. Do you use database URLs of the form jdbc:odbc:? Probably not. However the driver is loaded by default. Maybe it helps if you read the source code of this driver.
The second exception looks like an unclosed database connection to a H2 database. Could you check if the the stack trace in the file .trace.db?
On Sat, Oct 4, 2008 at 1:07 AM, kefa <k...@post.sk> wrote:
> Hello everyone,
> I'm getting strange exceptions in Finalizer thread. > First this exception happens: > Daemon System Thread [Finalizer] (Suspended (exception > NullPointerException)) > JdbcOdbcDriver.finalize() line: 96 [local variables unavailable] > Thread.run() line: 619 > When I click in the stack on line "JdbcOdbcDriver.finalize() line: 96 > [local variables unavailable]", Eclipse shows following variables: > this JdbcOdbcDriver (id=55) > iTimeOut 0 > outWriter null > tracer JdbcOdbcTracer (id=61) > outWriter null
> When I resume, immediately after first exception, second exception > happens: > Daemon System Thread [Finalizer] (Suspended (exception Error)) > Session.finalize() line: 212 [local variables unavailable] > Thread.run() line: 619
> Line number 212 in Session.java is this line: > throw Message.getInternalError("not closed", stackTrace);
> But I can't see the stack trace and no exception appears in my > DefaultUncaughtExceptionsHandler, so I can't provide more information. > Does anyone have an idea if this is OK? I would love to provide more > information, but I don't know how.
> I'm using the latest version of H2(1.0.79) and this happens *ONLY* > with JRockIt jrrt-3.0.0-1.6.0-windows-ia32.
Hi Thomas,
I have only this in the stack trace file:
10-04 23:04:20 jdbc[3]: SQLException
org.h2.jdbc.JdbcSQLException: Database is already closed (to disable
automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the
db URL) [90121-79]
at org.h2.message.Message.getSQLException(Message.java:103)
at org.h2.message.Message.getSQLException(Message.java:114)
at org.h2.message.Message.getSQLException(Message.java:77)
at org.h2.message.Message.getSQLException(Message.java:149)
at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1283)
at org.h2.jdbc.JdbcConnection.getAutoCommit(JdbcConnection.java:402)
at
com.ibatis.common.jdbc.SimpleDataSource.forceCloseAll(SimpleDataSource.java :
504)
at
com.ibatis.common.jdbc.SimpleDataSource.finalize(SimpleDataSource.java:
738)
at java.lang.Thread.run(Thread.java:619)
10-04 23:04:20 jdbc[3]: Connection not closed
java.lang.Exception: Stack Trace
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:142)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:88)
at org.h2.Driver.connect(Driver.java:57)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at
com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java :
580)
at
com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java :
222)
at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransact ion.java:
48)
at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(Jdb cTransaction.java:
89)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForO bject(MappedStatement.java:
120)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapE xecutorDelegate.java:
518)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapE xecutorDelegate.java:
493)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessio nImpl.java:
106)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientI mpl.java:
82)
at sk.trader.core.Backtester.test(Backtester.java:215)
at sk.trader.core.Backtester.runTest(Backtester.java:169)
at sk.trader.core.Backtester.start(Backtester.java:84)
at org.netbeans.api.wizard.displayer.WizardDisplayerImpl
$4.run(WizardDisplayerImpl.java:495)
at java.lang.Thread.run(Thread.java:619)
The two exceptions described in my 1st post are not there.
On Oct 4, 8:59 am, "Thomas Mueller" <thomas.tom.muel...@gmail.com>
wrote:
> The first exception is related to the JDBC-ODBC bridge that comes with
> the JDK. This is unrelated to H2. H2 doesn't use it. Do you use
> database URLs of the form jdbc:odbc:? Probably not. However the driver
> is loaded by default. Maybe it helps if you read the source code of
> this driver.
> The second exception looks like an unclosed database connection to a
> H2 database. Could you check if the the stack trace in the file
> .trace.db?
> Regards,
> Thomas
> On Sat, Oct 4, 2008 at 1:07 AM, kefa <k...@post.sk> wrote:
> > Hello everyone,
> > I'm getting strange exceptions in Finalizer thread.
> > First this exception happens:
> > Daemon System Thread [Finalizer] (Suspended (exception
> > NullPointerException))
> > JdbcOdbcDriver.finalize() line: 96 [local variables unavailable]
> > Thread.run() line: 619
> > When I click in the stack on line "JdbcOdbcDriver.finalize() line: 96
> > [local variables unavailable]", Eclipse shows following variables:
> > this JdbcOdbcDriver (id=55)
> > iTimeOut 0
> > outWriter null
> > tracer JdbcOdbcTracer (id=61)
> > outWriter null
> > When I resume, immediately after first exception, second exception
> > happens:
> > Daemon System Thread [Finalizer] (Suspended (exception Error))
> > Session.finalize() line: 212 [local variables unavailable]
> > Thread.run() line: 619
> > Line number 212 in Session.java is this line:
> > throw Message.getInternalError("not closed", stackTrace);
> > But I can't see the stack trace and no exception appears in my
> > DefaultUncaughtExceptionsHandler, so I can't provide more information.
> > Does anyone have an idea if this is OK? I would love to provide more
> > information, but I don't know how.
> > I'm using the latest version of H2(1.0.79) and this happens *ONLY*
> > with JRockIt jrrt-3.0.0-1.6.0-windows-ia32.
The first exception is because iBatis 2 tries to close all connections, but the given connection is already closed. See also: http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-c... - it is not problematic. Too bad iBatis doesn't use Connection.isClosed() before calling getAutoCommit().
The second stack trace is caused by an unclosed connection. The stack trace says the connection was opened in the given place:
at com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java :580) at com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java :222) at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransact ion.java:48) at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(Jdb cTransaction.java:89) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForO bject(MappedStatement.java:120) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapE xecutorDelegate.java:518) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapE xecutorDelegate.java:493) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessio nImpl.java:106) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientI mpl.java:82) at sk.trader.core.Backtester.test(Backtester.java:215) at sk.trader.core.Backtester.runTest(Backtester.java:169) at sk.trader.core.Backtester.start(Backtester.java:84) at org.netbeans.api.wizard.displayer.WizardDisplayerImpl
I suggest you check your code to make sure all iBatis object, connections and connection pools are closed.
On Sat, Oct 4, 2008 at 11:12 PM, kefa <k...@post.sk> wrote:
> Hi Thomas, > I have only this in the stack trace file:
> 10-04 23:04:20 jdbc[3]: SQLException > org.h2.jdbc.JdbcSQLException: Database is already closed (to disable > automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the > db URL) [90121-79] > at org.h2.message.Message.getSQLException(Message.java:103) > at org.h2.message.Message.getSQLException(Message.java:114) > at org.h2.message.Message.getSQLException(Message.java:77) > at org.h2.message.Message.getSQLException(Message.java:149) > at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1283) > at org.h2.jdbc.JdbcConnection.getAutoCommit(JdbcConnection.java:402) > at > com.ibatis.common.jdbc.SimpleDataSource.forceCloseAll(SimpleDataSource.java : > 504) > at > com.ibatis.common.jdbc.SimpleDataSource.finalize(SimpleDataSource.java: > 738) > at java.lang.Thread.run(Thread.java:619) > 10-04 23:04:20 jdbc[3]: Connection not closed > java.lang.Exception: Stack Trace > at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:142) > at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:88) > at org.h2.Driver.connect(Driver.java:57) > at java.sql.DriverManager.getConnection(DriverManager.java:582) > at java.sql.DriverManager.getConnection(DriverManager.java:185) > at > com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java : > 580) > at > com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java : > 222) > at > com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransact ion.java: > 48) > at > com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(Jdb cTransaction.java: > 89) > at > com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForO bject(MappedStatement.java: > 120) > at > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapE xecutorDelegate.java: > 518) > at > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapE xecutorDelegate.java: > 493) > at > com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessio nImpl.java: > 106) > at > com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientI mpl.java: > 82) > at sk.trader.core.Backtester.test(Backtester.java:215) > at sk.trader.core.Backtester.runTest(Backtester.java:169) > at sk.trader.core.Backtester.start(Backtester.java:84) > at org.netbeans.api.wizard.displayer.WizardDisplayerImpl > $4.run(WizardDisplayerImpl.java:495) > at java.lang.Thread.run(Thread.java:619)
> The two exceptions described in my 1st post are not there.
> On Oct 4, 8:59 am, "Thomas Mueller" <thomas.tom.muel...@gmail.com> > wrote: >> Hi,
>> The first exception is related to the JDBC-ODBC bridge that comes with >> the JDK. This is unrelated to H2. H2 doesn't use it. Do you use >> database URLs of the form jdbc:odbc:? Probably not. However the driver >> is loaded by default. Maybe it helps if you read the source code of >> this driver.
>> The second exception looks like an unclosed database connection to a >> H2 database. Could you check if the the stack trace in the file >> .trace.db?
>> Regards, >> Thomas
>> On Sat, Oct 4, 2008 at 1:07 AM, kefa <k...@post.sk> wrote:
>> > Hello everyone,
>> > I'm getting strange exceptions in Finalizer thread. >> > First this exception happens: >> > Daemon System Thread [Finalizer] (Suspended (exception >> > NullPointerException)) >> > JdbcOdbcDriver.finalize() line: 96 [local variables unavailable] >> > Thread.run() line: 619 >> > When I click in the stack on line "JdbcOdbcDriver.finalize() line: 96 >> > [local variables unavailable]", Eclipse shows following variables: >> > this JdbcOdbcDriver (id=55) >> > iTimeOut 0 >> > outWriter null >> > tracer JdbcOdbcTracer (id=61) >> > outWriter null
>> > When I resume, immediately after first exception, second exception >> > happens: >> > Daemon System Thread [Finalizer] (Suspended (exception Error)) >> > Session.finalize() line: 212 [local variables unavailable] >> > Thread.run() line: 619
>> > Line number 212 in Session.java is this line: >> > throw Message.getInternalError("not closed", stackTrace);
>> > But I can't see the stack trace and no exception appears in my >> > DefaultUncaughtExceptionsHandler, so I can't provide more information. >> > Does anyone have an idea if this is OK? I would love to provide more >> > information, but I don't know how.
>> > I'm using the latest version of H2(1.0.79) and this happens *ONLY* >> > with JRockIt jrrt-3.0.0-1.6.0-windows-ia32.