java.lang.ArrayIndexOutOfBoundsException: 0 in 1.2.124

1,397 views
Skip to first unread message

Steve McLeod

unread,
Jan 12, 2010, 5:24:23 AM1/12/10
to H2 Database
Using databases created with 1.2.124 in a desktop app, I'm
occasionally getting error reports from users with this exception:

org.h2.jdbc.JdbcSQLException: General error:
"java.lang.ArrayIndexOutOfBoundsException: 0"; SQL statement:
select sum(takeinbigblinds) as takeinbigblinds from PlayerSummary f
where f.isHero=true and f.isplaymoney=? and f.istournament=? and
f.dayid>=? and f.dayid<? and f.tableSize=? and f.gametypeid=? and
buyin=? [50000-124]
at org.h2.message.Message.getSQLException(Message.java:111)
at org.h2.message.Message.convert(Message.java:288)
at org.h2.message.Message.convert(Message.java:249)
at org.h2.command.Command.executeQueryLocal(Command.java:144)
at org.h2.command.Command.executeQuery(Command.java:123)
at org.h2.jdbc.JdbcPreparedStatement.executeQuery
(JdbcPreparedStatement.java:98)
at org.springframework.jdbc.core.JdbcTemplate
$1.doInPreparedStatement(JdbcTemplate.java:648)
at org.springframework.jdbc.core.JdbcTemplate.execute
(JdbcTemplate.java:591)
... 11 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:310)
at org.h2.index.PageDataLeaf.getRow(PageDataLeaf.java:427)
at org.h2.index.PageDataNode.getRow(PageDataNode.java:284)
at org.h2.index.PageDataNode.getRow(PageDataNode.java:284)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:377)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:366)
at org.h2.table.TableData.getRow(TableData.java:116)
at org.h2.index.PageBtreeIndex.getRow(PageBtreeIndex.java:284)
at org.h2.index.PageBtreeCursor.get(PageBtreeCursor.java:46)
at org.h2.index.IndexCursor.get(IndexCursor.java:146)
at org.h2.table.TableFilter.getValue(TableFilter.java:650)
at org.h2.expression.ExpressionColumn.getValue
(ExpressionColumn.java:168)
at org.h2.expression.Comparison.getValue(Comparison.java:215)
at org.h2.expression.ConditionAndOr.getValue
(ConditionAndOr.java:86)
at org.h2.expression.Expression.getBooleanValue(Expression.java:
188)
at org.h2.command.dml.Select.queryGroup(Select.java:309)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:551)
at org.h2.command.dml.Query.query(Query.java:236)
at org.h2.command.CommandContainer.query(CommandContainer.java:
82)
at org.h2.command.Command.executeQueryLocal(Command.java:142)
... 15 more

I'm unable to reproduce, but in at least one case I know this was
preceded by a user's MacBook running out of power.

The database url is:
jdbc:h2:~/
database;DATABASE_EVENT_LISTENER='com.barbarysoftware.pokercopilot.database.DatabaseListener';MAX_LENGTH_INPLACE_LOB=65536;COMPRESS_LOB=DEFLATE;CACHE_SIZE=65536

Any suggestions?

Thanks

Steve

Sam Van Oort

unread,
Jan 12, 2010, 10:33:09 AM1/12/10
to H2 Database
Hi Steve,

A couple general suggestions:

Increase the amount of heap memory given to Java (using -xmx) without
changing other settings. This gives it a bit more wiggle room for
operations requiring more memory.

Reduce max_length_inplace_lob to something more reasonable, such as
4096. 64 kB is quite excessive and may cause excessive memory use in
some cases (specifically with large transactions).

Reduce max_memory_rows (important if combined with the above) -- think
about how much memory your data will use, and make sure this will use
less than 1/4 the memory available for H2.

Try to break large transactions into several smaller transactions if
possible. H2 currently has memory problems on transactions which
touch more than 100,000 rows. This should be fixed in the next
couple builds, but in the meantime, consider switching to the old page
store (append ;page_store = false to your URL when creating the
database and connecting).

To help us correct any bugs in H2, please provide any of the following
information you can: a heap dump in cases when it runs out of memory,
a trace file containing the operations being performed when memory
problems occur, information about DB structure and row counts when
the problem occurs, specific queries that trigger problems.

Cheers,
Sam Van Oort
(Junior programmer, H2 project)

Steve McLeod

unread,
Jan 13, 2010, 6:03:42 AM1/13/10
to H2 Database
Hi Sam,

Thanks for the info and the suggestions.

* My h2 config is the result of much time spent configuring,
measuring, configuring, measuring, etc.
* It's common for my users to have a million CLOBS (TEXT fields), and
I found through measuring that there was an adverse performance effect
on inserts if I used the default max_length_inplace_lob setting.
* The JVM heap (-DXms64M -Xmx384M ) and H2 cache are also finely tuned
from months of iterative improvements, and tested on hundreds of
systems due to my very supportive key users. I am, however, always
looking for ways to improve the tuning.
* My transactions are small, just a few queries at a time.
* I didn't know about max_memory_rows and will try this for tuning.

But none of this fits the problems I'm seeing: When a machine loses
power unexpectedly, for example, sometimes that leaves the database in
an unusable state. The table which generates the Exception I showed in
the original post is a fact table in a star schema:

CREATE TABLE PlayerSummary
(
playerid INTEGER NOT NULL,
dayid INTEGER NOT NULL,
isplaymoney BOOLEAN NOT NULL,
tableSize INTEGER NOT NULL,
gametypeid INTEGER NOT NULL,
positionid INTEGER NOT NULL,
stakelevelid INTEGER NOT NULL,
tournamentid INTEGER NOT NULL,

playerName VARCHAR(32) NOT NULL,
istournament BOOLEAN NOT NULL,
isHero BOOLEAN NOT NULL,
buyin INTEGER,
casinoid INTEGER NOT NULL,
startTime DATETIME NOT NULL,
takeInCents INTEGER,
showdowntakeInCents INTEGER,
nonshowdowntakeInCents INTEGER,
takeInBigBlinds DOUBLE,
timesseen INTEGER,
flopseen INTEGER,
vpip INTEGER,
preflopraised INTEGER,
postflopbet INTEGER,
postflopraised INTEGER,
postflopcalled INTEGER,
postflopfolded INTEGER,
postflopbetorraised INTEGER,
postFlopCallFoldBetOrRaise INTEGER,
blindStealAttempt INTEGER,
blindStealAttemptOpportunity INTEGER,
checkRaised INTEGER,
checkRaisedOpportunity INTEGER,
wentToShowdown INTEGER,
wonAtShowdown INTEGER,
wonWithoutShowdown INTEGER,
threeBetPreflop INTEGER,
threebetPreflopOpportunity INTEGER,
blindStealDefenseOpportunityOnBigBlind INTEGER,
calledPreflopRaise INTEGER,
calledPreflopRaiseOpportunity INTEGER,
continuationBetPreflop INTEGER,
continuationBetPreflopOpportunity INTEGER,
foldedToBlindStealOnBigBlind INTEGER,
foldedToContinuationBet INTEGER,
foldedToContinuationBetOpportunity INTEGER,
foldedToPreflopThreeBet INTEGER,
foldedToPreflopThreeBetOpportunity INTEGER,
PRIMARY KEY
(playerid,dayid,isplaymoney,tableSize,gametypeid,positionid,stakelevelid,tournamentid)
);

CREATE INDEX PlayerSummary_tournamentid_idx ON PlayerSummary
(tournamentid);
CREATE INDEX ps_idx_1 on playersummary
(dayid,isplaymoney,istournament,ishero,positionid,stakelevelid,tablesize,gametypeid);
CREATE INDEX ps_idx_2 on playersummary
(playerid,isplaymoney,istournament,tablesize);

The exception happens on a SELECT statement.

Thanks again for your help.

Regards,

Steve McLeod

Alexander Hartner

unread,
Jan 13, 2010, 1:35:26 PM1/13/10
to h2-da...@googlegroups.com
I am getting a similar error using H2, version: 1.2.126 (2009-12-18). I can't rule out database corruption due to power issues / system crashes.

2010-Jan-13 18:27:03 [CentralAddressBook - FATAL] Contact ID criteria : IN ('585F7196-10F8-4ED8-8948-839B2653EBDE')
2010-Jan-13 18:27:04 [JCLLoggerAdapter - WARN] SQL Error: 50000, SQLState: HY000
2010-Jan-13 18:27:04 [JCLLoggerAdapter - ERROR] General error: "java.lang.ArrayIndexOutOfBoundsException: 0"; SQL statement:
select event0_.identifier as col_0_0_ from Events event0_ inner join Calendars calendar1_ on event0_.calendar_identifier=calendar1_.identifier where calendar1_.identifier in ('44536898-CC73-4518-9AAB-A0FED43FD528' , '98A8EC8D-DD9E-4A39-889C-15A5310FAD0B' , '8BD16B5E-CE05-4915-A925-E447D507A662' , '7BF6CA5F-3A47-42EF-8AD9-7CABB74DE9DE' , 'C8297C51-0CEC-4C84-816E-AD566A955CC9' , '8BC8F011-1A80-4A1A-9653-F41424EB590D' , 'B6DB7ED4-C948-48BB-8205-2CBC5A252CA8' , 'C97C0A13-02F9-4ADB-BC8E-6DCBD1730CA3' , 'B51C43E9-28D5-41F4-918D-184C7C0C6793' , 'F911F55F-2737-4A94-B5E5-24972FE02892' , 'F2A4EE0B-71F8-444D-A379-FFC26EDF574A') [50000-126]
2010-Jan-13 18:27:04 [CentralAddressBook - FATAL] GetAvailableEventOrTaskIdentifiersInCalendars failed
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
at com.j2anywhere.addressbookserver.CentralAddressBook.getAvailableEventOrTaskIdentifiersInCalendars(CentralAddressBook.java:470)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:141)
at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.handle(WSServletDelegate.java:333)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:288)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2231)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
at org.hibernate.loader.Loader.list(Loader.java:2120)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
... 28 more

> --
> You received this message because you are subscribed to the Google Groups "H2 Database" group.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to h2-database...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
>
>

Alexander Hartner

unread,
Jan 13, 2010, 7:17:47 PM1/13/10
to h2-da...@googlegroups.com
I haven't been able to reproduce this. Hopefully the stack trace and the query shed some light on the underlying cause of this issue.

Regards
Alex

Sam Van Oort

unread,
Jan 13, 2010, 8:13:05 PM1/13/10
to H2 Database
Hi Alexander,

It looks like there are some remaining bugs with the 1.2.x branch
(still considered to be in beta, I believe). Unfortunately, I'm not
familiar enough with the codebase for the storage engines to be of
assistance here -- it's going to have to wait for Mr. Mueller. If
you can provide as much information as possible to help him fix this
one, it will help. Please see: http://www.h2database.com/html/build.html#support

@Steve: the same applies here, I'm afraid. My gut says there may be
quirks due to your very large and complex rows, and not being able to
finish writing rows during power outages. But that's just a hunch.

Obviously the proximate cause is a PageDataLeaf.rows being a zero-
sized array, but I can't figure out how this would happen as a result
of power outage. I really wish I could help more -- please post as
much information as you can, and await a reply from Mr. Mueller within
a few days.

Cheers,
Sam Van Oort

On Jan 13, 1:35 pm, Alexander Hartner <lostinspace2...@googlemail.com>
wrote:

Thomas Mueller

unread,
Jan 15, 2010, 10:04:00 AM1/15/10
to h2-da...@googlegroups.com
Hi,

> org.h2.jdbc.JdbcSQLException: General error:
> "java.lang.ArrayIndexOutOfBoundsException: 0"

> I'm unable to reproduce, but in at least one case I know this was
> preceded by a user's MacBook running out of power.

I'm not sure what the problem could be, but I guess it could be
related to running out of power. I did run a test case where power is
switched off, but only a relatively simple test case so far. I will
extend it to include larger binaries and additional indexes (with many
columns).

What file system do you use? While running the 'power failure' test I
did see file system problems sometime (specially with Windows FAT, but
also with EXT2 once where it had a corrupted last modification time).

With what version was the database created? You can find it out using:
select * from information_schema.settings where name='CREATE_BUILD'.

Is the database usually closed normally, or is process terminated
forcefully or the computer switched off? (Except in the case where you
know the battery died). Are there any other exceptions (maybe in the
.trace.db file)?

Could you send the .h2.db file where this exception occurs? If not,
could you run the Recover tool and check the result?

It could be related to running out of memory. Is there any exception
in the .trace.db file? In version 1.2.125, the behavior on out of
memory was changes: "The database is now closed after an out of memory
exception".

Thomas Mueller

unread,
Jan 15, 2010, 10:06:47 AM1/15/10
to h2-da...@googlegroups.com
Hi Alexander,

> 2010-Jan-13 18:27:04 [JCLLoggerAdapter - ERROR] General error: "java.lang.ArrayIndexOutOfBoundsException: 0"; SQL statement:

Thanks for your mail. This exception message looks very similar to the
one from Steve McLeod, however the 'root cause' of the exception is
missing. Could you check if there is more in the .trace.db file?

Additionally I would be interested in the same information as I asked
before (database create version, file system,...).

Regards,
Thomas

Alexander Hartner

unread,
Feb 1, 2010, 6:33:35 PM2/1/10
to h2-da...@googlegroups.com, Steve McLeod, Thomas Mueller
Would this help ? Not quite sure which version that was with. I believe it could be 1.2.126 (from the exception [50000-126]) but I am not sure at all. I will try to find out more details.

Kind regards
Alex

Caused by: com.j2anywhere.addressbookserver.AddressBookServerException: org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.j2anywhere.addressbookserver.entities.Calendar.events#D18A4104-AA73-4C56-9B3B-0F4F75757E12]
	at com.j2anywhere.addressbookserver.web.DataController.getCalendarNames(DataController.java:640)
	at com.j2anywhere.addressbookserver.web.CalendarController.readCalendarNames(CalendarController.java:62)
	at com.j2anywhere.addressbookserver.web.CalendarController.(CalendarController.java:40)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at java.lang.Class.newInstance0(Class.java:355)
	at java.lang.Class.newInstance(Class.java:308)
	at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
	... 46 more
Caused by: org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.j2anywhere.addressbookserver.entities.Calendar.events#D18A4104-AA73-4C56-9B3B-0F4F75757E12]
	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
	at org.hibernate.loader.Loader.loadCollection(Loader.java:2022)
	at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:59)
	at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
	at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
	at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1743)
	at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366)
	at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
	at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:131)
	at org.hibernate.collection.PersistentBag.size(PersistentBag.java:248)
	at com.j2anywhere.addressbookserver.web.DataController.getCalendarNames(DataController.java:627)
	... 55 more
Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.ArrayIndexOutOfBoundsException"; SQL statement:
select events0_.calendar_identifier as calendar17_1_, events0_.identifier as identifier1_, events0_.identifier as identifier16_0_, events0_.changeType as changeType16_0_, events0_.updatedOn as updatedOn16_0_, events0_.allDay as allDay16_0_, events0_.calendar_identifier as calendar17_16_0_, events0_.classification as classifi5_16_0_, events0_.description as descript6_16_0_, events0_.endDate as endDate16_0_, events0_.floatingGMTDate as floating8_16_0_, events0_.floatingOffset as floating9_16_0_, events0_.location as location16_0_, events0_.originalDate as origina11_16_0_, events0_.priority as priority16_0_, events0_.startDate as startDate16_0_, events0_.status as status16_0_, events0_.summary as summary16_0_, events0_.url as url16_0_ from Events events0_ where events0_.calendar_identifier=? [50000-126]
	at org.h2.message.Message.getSQLException(Message.java:110)
	at org.h2.message.Message.convert(Message.java:287)
	at org.h2.message.Message.convert(Message.java:248)
	at org.h2.command.Command.executeQuery(Command.java:134)
	at org.h2.server.TcpServerThread.process(TcpServerThread.java:283)
	at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
	at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.ArrayIndexOutOfBoundsException

	at org.h2.engine.SessionRemote.done(SessionRemote.java:522)
	at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:161)
	at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:98)
	at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
	at org.hibernate.loader.Loader.doQuery(Loader.java:697)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
	at org.hibernate.loader.Loader.loadCollection(Loader.java:2015)
	... 64 more


Alexander Hartner

unread,
Mar 31, 2010, 6:27:56 PM3/31/10
to h2-da...@googlegroups.com
Hi all,

I am still getting this using 1.2.128. Should I try with the latest release build ? Please let me know if you require further details.

2010-mars-31 07:56:55 [JCLLoggerAdapter - WARN] SQL Error: 50000, SQLState: HY000
2010-mars-31 07:56:55 [JCLLoggerAdapter - ERROR] General error: "java.lang.ArrayIndexOutOfBoundsException: 0"; SQL statement:
select emailaddre0_.identifier as identifier3_, emailaddre0_.changeType as changeType3_, emailaddre0_.updatedOn as updatedOn3_, emailaddre0_.CONTACTIDENTIFIER as CONTACTI7_3_, emailaddre0_.label as label3_, emailaddre0_.type as type3_, emailaddre0_.value as value3_ from EmailAddresses emailaddre0_ where emailaddre0_.updatedOn>? and emailaddre0_.changeType<>? [50000-128]
2010-mars-31 07:56:55 [CentralAddressBook - FATAL] Unable to Fetch. TX roll'd back.


javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)

at com.j2anywhere.addressbookserver.SyncService.fetchRecords(SyncService.java:203)
at com.j2anywhere.addressbookserver.CentralAddressBook.fetchRecords(CentralAddressBook.java:79)


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:141)
at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.handle(WSServletDelegate.java:333)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:288)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)


at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query


at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

at org.hibernate.loader.Loader.doList(Loader.java:2235)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)


at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)

... 30 more
Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.ArrayIndexOutOfBoundsException: 0"; SQL statement:
select emailaddre0_.identifier as identifier3_, emailaddre0_.changeType as changeType3_, emailaddre0_.updatedOn as updatedOn3_, emailaddre0_.CONTACTIDENTIFIER as CONTACTI7_3_, emailaddre0_.label as label3_, emailaddre0_.type as type3_, emailaddre0_.value as value3_ from EmailAddresses emailaddre0_ where emailaddre0_.updatedOn>? and emailaddre0_.changeType<>? [50000-128]


at org.h2.message.Message.getSQLException(Message.java:110)
at org.h2.message.Message.convert(Message.java:287)
at org.h2.message.Message.convert(Message.java:248)
at org.h2.command.Command.executeQuery(Command.java:134)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:283)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
at java.lang.Thread.run(Thread.java:637)

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:310)

at org.h2.index.PageDataCursor.nextRow(PageDataCursor.java:103)
at org.h2.index.PageDataCursor.next(PageDataCursor.java:55)
at org.h2.index.IndexCursor.next(IndexCursor.java:184)
at org.h2.table.TableFilter.next(TableFilter.java:279)
at org.h2.command.dml.Select.queryFlat(Select.java:491)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:558)
at org.h2.command.dml.Query.query(Query.java:243)
at org.h2.command.CommandContainer.query(CommandContainer.java:81)
at org.h2.command.Command.executeQuery(Command.java:132)
... 3 more

at org.h2.engine.SessionRemote.done(SessionRemote.java:522)
at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:158)


at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:98)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)

at org.hibernate.loader.Loader.getResultSet(Loader.java:1812)


at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)

at org.hibernate.loader.Loader.doList(Loader.java:2232)
... 38 more


2010-mars-31 08:25:41 [JCLLoggerAdapter - WARN] SQL Error: 50000, SQLState: HY000
2010-mars-31 08:25:41 [JCLLoggerAdapter - ERROR] General error: "java.lang.ArrayIndexOutOfBoundsException"; SQL statement:
select emailaddre0_.identifier as identifier3_, emailaddre0_.changeType as changeType3_, emailaddre0_.updatedOn as updatedOn3_, emailaddre0_.CONTACTIDENTIFIER as CONTACTI7_3_, emailaddre0_.label as label3_, emailaddre0_.type as type3_, emailaddre0_.value as value3_ from EmailAddresses emailaddre0_ where emailaddre0_.updatedOn>? and emailaddre0_.changeType<>? [50000-128]
2010-mars-31 08:25:41 [CentralAddressBook - FATAL] Unable to Fetch. TX roll'd back.


javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)

at com.j2anywhere.addressbookserver.SyncService.fetchRecords(SyncService.java:203)
at com.j2anywhere.addressbookserver.CentralAddressBook.fetchRecords(CentralAddressBook.java:79)


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:141)
at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.handle(WSServletDelegate.java:333)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:288)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)


at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query


at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

at org.hibernate.loader.Loader.doList(Loader.java:2235)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)


at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)

... 30 more


Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.ArrayIndexOutOfBoundsException"; SQL statement:

select emailaddre0_.identifier as identifier3_, emailaddre0_.changeType as changeType3_, emailaddre0_.updatedOn as updatedOn3_, emailaddre0_.CONTACTIDENTIFIER as CONTACTI7_3_, emailaddre0_.label as label3_, emailaddre0_.type as type3_, emailaddre0_.value as value3_ from EmailAddresses emailaddre0_ where emailaddre0_.updatedOn>? and emailaddre0_.changeType<>? [50000-128]


at org.h2.message.Message.getSQLException(Message.java:110)
at org.h2.message.Message.convert(Message.java:287)
at org.h2.message.Message.convert(Message.java:248)
at org.h2.command.Command.executeQuery(Command.java:134)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:283)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.ArrayIndexOutOfBoundsException

at org.h2.engine.SessionRemote.done(SessionRemote.java:522)
at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:158)


at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:98)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)

at org.hibernate.loader.Loader.getResultSet(Loader.java:1812)


at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)

at org.hibernate.loader.Loader.doList(Loader.java:2232)
... 38 more

On 12 Jan 2010, at 10:24, Steve McLeod wrote:

Alexander Hartner

unread,
Apr 1, 2010, 1:28:17 PM4/1/10
to H2 Google Group, Thomas Mueller
I managed to find a tracedb file containing the following

03-29 23:16:26 database: opening /usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.24/db/AddressBookDB
org.h2.jdbc.JdbcSQLException: File corrupted while reading record: "15454 of 15368". Possible solution: use the recovery tool [90030-128]
at org.h2.message.Message.getSQLException(Message.java:110)
at org.h2.message.Message.getSQLException(Message.java:121)
at org.h2.message.Message.getSQLException(Message.java:74)
at org.h2.store.PageStore.readPage(PageStore.java:969)
at org.h2.store.PageStore.getPage(PageStore.java:486)
at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:212)
at org.h2.index.PageDataNode.getLastKey(PageDataNode.java:223)
at org.h2.index.PageDataNode.getLastKey(PageDataNode.java:223)
at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:76)
at org.h2.table.TableData.<init>(TableData.java:83)
at org.h2.store.PageStore.addMeta(PageStore.java:1307)
at org.h2.store.PageStore.readMetaData(PageStore.java:1245)
at org.h2.store.PageStore.recover(PageStore.java:1053)
at org.h2.store.PageStore.openExisting(PageStore.java:306)
at org.h2.store.PageStore.open(PageStore.java:264)
at org.h2.engine.Database.getPageStore(Database.java:2334)
at org.h2.engine.Database.open(Database.java:631)
at org.h2.engine.Database.openDatabase(Database.java:228)
at org.h2.engine.Database.<init>(Database.java:223)
at org.h2.engine.Engine.openSession(Engine.java:58)
at org.h2.engine.Engine.openSession(Engine.java:142)
at org.h2.engine.Engine.getSession(Engine.java:122)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:121)
at java.lang.Thread.run(Thread.java:637)
03-29 23:25:04 database: close
java.lang.NullPointerException
at org.h2.index.PageDataNode.moveTo(PageDataNode.java:418)
at org.h2.store.PageStore.compact(PageStore.java:461)
at org.h2.store.PageStore.compact(PageStore.java:402)
at org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1307)
at org.h2.engine.Database.close(Database.java:1246)
at org.h2.engine.Database.removeSession(Database.java:1135)
at org.h2.engine.Session.close(Session.java:563)
at org.h2.server.TcpServerThread.closeSession(TcpServerThread.java:159)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:247)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
at java.lang.Thread.run(Thread.java:637)
03-31 00:40:34 database: close
java.lang.NullPointerException
at org.h2.index.PageDataNode.moveTo(PageDataNode.java:418)
at org.h2.store.PageStore.compact(PageStore.java:461)
at org.h2.store.PageStore.compact(PageStore.java:402)
at org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1307)
at org.h2.engine.Database.close(Database.java:1246)
at org.h2.engine.DatabaseCloser.run(DatabaseCloser.java:80)

Begin forwarded message:

Thomas Mueller

unread,
Apr 1, 2010, 6:26:56 PM4/1/10
to h2-da...@googlegroups.com
Hi,

I'm not sure if this is really the problem, but in version 1.2.131 a
similar problem was fixed - see also the change log at
http://www.h2database.com/html/changelog.html "An
IndexOutOfBoundsException could occur in the page store (eg. on
"delete from table"). Fixed.". Actually it's
ArrayIndexOutOfBoundsException.

Could you try with the latest release? Maybe the problem is within the
database, that means you would need to re-create the database using
SCRIPT TO / RUNSCRIPT FROM.

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages