Mantis - Resin
Viewing Issue Advanced Details
2337 minor always 01-16-08 08:22 02-07-08 12:44
ferg  
ferg  
normal  
closed 3.1.4  
fixed  
none    
none 3.1.5  
0002337: jms/db ArrayIndexException
(rep by Erlende Akre)

 I am trying out Resin and the JMS part.
I've successfully set up a queue that uses the default disk database.
 
I'm doing the sending and receiving from php using the very simple examples:
 
$queue = new JMSQueue("jms/myqueue");
 
$queue->send(...)
and
$queue->receive();
 
Everything works fine. But when doing some stress testing I start running into problems.
 
Using send() in a for loop works fine with 500,800,1000,2000 repetitions..
If I set this higher (5000 repetitions) the page is never returned (which means the loops stops executing?)
 
I removed the database and started off clean.. I slowly added 500 messages each time with around 30 sec apart.
There where no problems with sending, and the filesize of the database increased every time.
 
When I run the .php file with the receive() in it, I get an ArrayIndexOutOfBoundsException. This is not fixed by stopping and starting server, I actually have to delete the database on disk to get it to work again.
 
Anyone else had this kind of problem, that heavy use corrupts the database?
 
Error message from receive():
500 Servlet Exception

java.lang.ArrayIndexOutOfBoundsException: 128
        at com.caucho.db.sql.SelectResult.write(SelectResult.java:1013)
        at com.caucho.db.sql.SelectResult.writeBlob(SelectResult.java:919)
        at com.caucho.db.table.BlobColumn.evalToResult(BlobColumn.java:351)
        at com.caucho.db.table.TableIterator.evalToResult(TableIterator.java:424)
        at com.caucho.db.sql.IdExpr.evalToResult(IdExpr.java:226)
        at com.caucho.db.sql.SelectQuery.execute(SelectQuery.java:194)
        at com.caucho.db.sql.SelectQuery.execute(SelectQuery.java:161)
        at com.caucho.db.jdbc.PreparedStatementImpl.execute(PreparedStatementImpl.java:335)
        at com.caucho.db.jdbc.PreparedStatementImpl.executeQuery(PreparedStatementImpl.java:302)
        at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:89)
        at com.caucho.jms.jdbc.JdbcQueueConsumer.receiveImpl(JdbcQueueConsumer.java:266)
        at com.caucho.jms.session.MessageConsumerImpl.receiveNoWait(MessageConsumerImpl.java:254)
        at com.caucho.jms.session.MessageConsumerImpl.receive(MessageConsumerImpl.java:222)
        at com.caucho.quercus.lib.jms.JMSQueue.receive(JMSQueue.java:154)
        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.caucho.quercus.env.JavaMethod.invoke(JavaMethod.java:97)
        at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:615)
        at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:622)
        at com.caucho.quercus.program.JavaClassDef.callMethod(JavaClassDef.java:542)
        at com.caucho.quercus.env.JavaValue.callMethod(JavaValue.java:294)
        at com.caucho.quercus.env.Var.callMethod(Var.java:1166)
        at _quercus._get__php.execute(usr/local/resin-pro-3.1.3/webapps/ROOT/get.php:10)
        at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java:119)
        at com.caucho.quercus.servlet.ResinQuercusServlet.service(ResinQuercusServlet.java:146)
        at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:353)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
        at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
        at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
        at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:241)
        at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268)
        at com.caucho.server.port.TcpConnection.run(TcpConnection.java:586)
        at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:690)
        at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:612)
        at java.lang.Thread.run(Thread.java:619)
 

Notes
(0002732)
ferg   
02-07-08 12:44   
db/01ka