lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

NullPointerException on 1.1.115 #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We turned on second level cache recently and saw this error message this
morning, it was not always happen, seems a random issue

Caused by: java.lang.NullPointerException
    at org.h2.util.SoftHashMap.remove(SoftHashMap.java:77)
    at org.h2.util.CacheSecondLevel.remove(CacheSecondLevel.java:72)
    at org.h2.store.DiskFile.removeRecord(DiskFile.java:1006)
    at org.h2.store.Storage.removeRecord(Storage.java:210)
    at org.h2.index.BtreeIndex.deletePage(BtreeIndex.java:160)
    at org.h2.index.BtreeLeaf.remove(BtreeLeaf.java:109)
    at org.h2.index.BtreeNode.remove(BtreeNode.java:147)
    at org.h2.index.BtreeNode.remove(BtreeNode.java:147)
    at org.h2.index.BtreeNode.remove(BtreeNode.java:147)
    at org.h2.index.BtreeIndex.remove(BtreeIndex.java:261)
    at 

I looked at the source code:

SoftReference<V> ref = map.remove(key);
return ref.get();

Is the null check necessary here?

Is it a bug or something we need to configure?

Full stacetrace
---------------------------

org.h2.jdbc.JdbcSQLException: General error:
java.lang.NullPointerException; SQL statement:
         UPDATE builds SET state=? WHERE id = ?      [50000-115]
    at org.h2.message.Message.getSQLException(Message.java:105)
    at org.h2.message.Message.convert(Message.java:277)
    at org.h2.table.TableData.removeRow(TableData.java:334)
    at org.h2.table.Table.updateRows(Table.java:380)
    at org.h2.command.dml.Update.update(Update.java:132)
    at org.h2.command.CommandContainer.update(CommandContainer.java:72)
    at org.h2.command.Command.executeUpdate(Command.java:208)
    at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:175)
    at
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedSt
atement.java:169)
    at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80
)
    at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(Mapp
edStatement.java:216)
    at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedS
tatement.java:94)
    at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelega
te.java:457)
    at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:90
)
    at
org.springframework.orm.ibatis.SqlMapClientTemplate$10.doInSqlMapClient(SqlMapCl
ientTemplate.java:413)
    at
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate
.java:209)
    at
org.springframework.orm.ibatis.SqlMapClientTemplate.update(SqlMapClientTemplate.
java:411)
    at
com.thoughtworks.cruise.server.dao.JobInstanceSqlMapDao.updateStatus(JobInstance
SqlMapDao.java:100)
    at
com.thoughtworks.cruise.server.service.JobInstanceService.updateStatus(JobInstan
ceService.java:77)
    at
com.thoughtworks.cruise.server.service.JobInstanceService.updateStateAndResult(J
obInstanceService.java:71)
    at
com.thoughtworks.cruise.server.service.JobInstanceService$$FastClassByCGLIB$$bc7
4f026.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at
org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoi
npoint(Cglib2AopProxy.java:700)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:149)
    at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
ctionInterceptor.java:106)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:171)
    at
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.inter
cept(Cglib2AopProxy.java:635)
    at
com.thoughtworks.cruise.server.service.JobInstanceService$$EnhancerByCGLIB$$e661
9e88.updateStateAndResult(<generated>)
    at
com.thoughtworks.cruise.server.service.BuildRepositoryService.completing(BuildRe
positoryService.java:47)
    at
com.thoughtworks.cruise.remote.BuildRepositoryRemoteImpl.reportResult(BuildRepos
itoryRemoteImpl.java:86)
    at
com.thoughtworks.cruise.server.messaging.BuildRepositoryMessageProducer.reportRe
sult(BuildRepositoryMessageProducer.java:34)
    at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
.java:310)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
lectiveMethodInvocation.java:182)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:149)
    at
org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(Rem
oteInvocationTraceInterceptor.java:70)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:171)
    at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:204)
    at $Proxy22.reportResult(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.ja
va:205)
    at
org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(Defa
ultRemoteInvocationExecutor.java:38)
    at
org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(Remote
InvocationBasedExporter.java:78)
    at
org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCrea
teResult(RemoteInvocationBasedExporter.java:114)
    at
org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleReques
t(HttpInvokerServiceExporter.java:74)
    at
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequest
HandlerAdapter.java:49)
    at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.j
ava:874)
    at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.ja
va:808)
    at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet
.java:523)
    at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:46
3)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
    at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1157)
    at
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
    at
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90
)
    at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.jav
a:417)
    at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1148)
    at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:359)
    at
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(Filt
erSecurityInterceptor.java:109)
    at
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(Fi
lterSecurityInterceptor.java:83)
    at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:371)
    at
org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(Exceptio
nTranslationFilter.java:101)
    at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilt
er.java:53)
    at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:371)
    at
org.springframework.security.ui.x509.X509ProcessingFilter.doFilter(X509Processin
gFilter.java:137)
    at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:371)
    at
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.jav
a:174)
    at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFi
lterProxy.java:183)
    at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterPr
oxy.java:138)
    at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1148)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
    at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
    at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Caused by: java.lang.NullPointerException
    at org.h2.util.SoftHashMap.remove(SoftHashMap.java:77)
    at org.h2.util.CacheSecondLevel.remove(CacheSecondLevel.java:72)
    at org.h2.store.DiskFile.removeRecord(DiskFile.java:1006)
    at org.h2.store.Storage.removeRecord(Storage.java:210)
    at org.h2.index.BtreeIndex.deletePage(BtreeIndex.java:160)
    at org.h2.index.BtreeLeaf.remove(BtreeLeaf.java:109)
    at org.h2.index.BtreeNode.remove(BtreeNode.java:147)
    at org.h2.index.BtreeNode.remove(BtreeNode.java:147)
    at org.h2.index.BtreeNode.remove(BtreeNode.java:147)
    at org.h2.index.BtreeIndex.remove(BtreeIndex.java:261)
    at org.h2.index.MultiVersionIndex.remove(MultiVersionIndex.java:145)
    at org.h2.table.TableData.removeRow(TableData.java:316)
    ... 88 more

Original issue reported on code.google.com by Iamka...@gmail.com on 2 Jul 2009 at 2:47

GoogleCodeExporter commented 9 years ago
Thanks! This will be fixed in the next release.

Original comment by thomas.t...@gmail.com on 2 Jul 2009 at 8:12

GoogleCodeExporter commented 9 years ago
This bug is fixed with the latest release (1.1.116).
If there is still a problem, please open a new issue.

Original comment by thomas.t...@gmail.com on 18 Jul 2009 at 9:54