db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject NPE in Derby
Date Sat, 17 Dec 2005 20:49:11 GMT
Any idea what would cause:

17/12/05 11:26:36 ERROR mailstore: Error retrieving pending messages
java.lang.NullPointerException
        at
org.apache.derby.impl.store.access.conglomerate.GenericConglomerateControlle
r.fetch(Unknown Source)
        at
org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.getNextRowCore(
Unknown Source)
        at
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Un
known Source)
        at
org.apache.derby.impl.sql.execute.SortResultSet.getRowFromResultSet(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.SortResultSet.getNextRowFromRS(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(Unknown Source)
        at org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown
Source)
        at
org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        at
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
Source)
        at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown
Source)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingP
reparedStatement.java:92)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.loadPendingMessages(JDBC
SpoolRepository.java:277)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.getNextPendingMessage(JD
BCSpoolRepository.java:249)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolReposito
ry.java:193)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolReposito
ry.java:123)
        at
org.apache.james.mailrepository.MailStoreSpoolRepository.accept(MailStoreSpo
olRepository.java:104)
        at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invo
ke(BlockInvocationHandler.java:92)
        at $Proxy4.accept(Unknown Source)
        at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:305)
        at java.lang.Thread.run(Thread.java:534)

This was the sole exception in all JAMES logs after many hours of testing,
and JAMES did recover from it.  I happened to have Derby's own logging
enabled, and this was the matching record in derby.log (the only exception
in 2.1GB of derby log data):

2005-12-17 16:26:36.547 GMT Thread[Spool Thread #7,5,main] (XID = 2552591),
(SESSIONID = 805912), (DATABASE = ../apps/james/var/derby/derbydb), (DRDAID
= null), Cleanup action starting
2005-12-17 16:26:36.551 GMT Thread[Spool Thread #7,5,main] (XID = 2552591),
(SESSIONID = 805912), (DATABASE = ../apps/james/var/derby/derbydb), (DRDAID
= null), Failed Statement is: SELECT message_name, message_state,
last_updated, error_message FROM spool WHERE repository_name = ? ORDER BY
last_updated ASC with 1 parameters begin parameter #1: spool :end parameter
java.lang.NullPointerException
        at
org.apache.derby.impl.store.access.conglomerate.GenericConglomerateControlle
r.fetch(Unknown Source)
        at
org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.getNextRowCore(
Unknown Source)
        at
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Un
known Source)
        at
org.apache.derby.impl.sql.execute.SortResultSet.getRowFromResultSet(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.SortResultSet.getNextRowFromRS(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(Unknown Source)
        at org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown
Source)
        at
org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        at
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
Source)
        at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown
Source)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingP
reparedStatement.java:92)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.loadPendingMessages(JDBC
SpoolRepository.java:277)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.getNextPendingMessage(JD
BCSpoolRepository.java:249)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolReposito
ry.java:193)
        at
org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolReposito
ry.java:123)
        at
org.apache.james.mailrepository.MailStoreSpoolRepository.accept(MailStoreSpo
olRepository.java:104)
        at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invo
ke(BlockInvocationHandler.java:92)
        at $Proxy4.accept(Unknown Source)
        at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:305)
        at java.lang.Thread.run(Thread.java:534)
Cleanup action completed

Our code is the loadPendingMessages method in JDBCSpoolRepository, which
executes the listMessagesSQL query found in sqlResources.xml.

ref:
http://svn.apache.org/repos/asf/james/server/trunk/src/java/org/apache/james
/mailrepository/JDBCSpoolRepository.java
     http://svn.apache.org/repos/asf/james/server/trunk/src/conf/sqlResource
s.xml

I don't see anything the SQL statement that I would expect to cause a
problem.  Internal race condition?

Thanks.  :-)

	--- Noel


Mime
View raw message