Skip to main content

MMS 2.0.0.CR1 problem

1 reply [Last post]
pipestradas
Offline
Joined: 2010-04-27

Hi. Please help me with one issue. When I try to create a lot of media sessions with Mobicents Media Server (MMS) 2.0.0.CR1, there is a point where the next exception is displayed:

.....
Exception in thread "Scheduler" java.lang.ArrayIndexOutOfBoundsException: 900
at org.mobicents.media.server.impl.clock.Scheduler.run(Scheduler.java:123)
at java.lang.Thread.run(Thread.java:619)
Connection index=0
java.lang.ArrayIndexOutOfBoundsException: 901
at org.mobicents.media.server.impl.clock.Scheduler.execute(Scheduler.java:63)
at org.mobicents.media.server.impl.clock.TimerImpl.sync(TimerImpl.java:84)
at org.mobicents.media.server.impl.AbstractSource.start(AbstractSource.java:187)
at org.mobicents.media.server.impl.resource.cnf.AudioMixer.start(AudioMixer.java:101)
at org.mobicents.media.server.resource.Channel.start(Channel.java:193)
at org.mobicents.media.server.ConnectionImpl.setMode(ConnectionImpl.java:237)
at org.mobicents.media.server.ConnectionImpl.bind(ConnectionImpl.java:158)
at org.mobicents.media.server.RtpConnectionImpl.bind(RtpConnectionImpl.java:143)
at org.mobicents.media.server.RtpConnectionImpl.bind(RtpConnectionImpl.java:153)
at org.mobicents.media.server.EndpointImpl.createConnection(EndpointImpl.java:430)
at org.mobicents.media.server.ctrl.mgcp.CreateConnectionAction.createRtpConnection(CreateConnectionAction.java:120)
at org.mobicents.media.server.ctrl.mgcp.CreateConnectionAction.call(CreateConnectionAction.java:357)
at org.mobicents.media.server.ctrl.mgcp.CreateConnectionAction.call(CreateConnectionAction.java:50)
at org.mobicents.media.server.ctrl.mgcp.MgcpController.processMgcpCommandEvent(MgcpController.java:228)
at org.mobicents.protocols.mgcp.stack.JainMgcpStackProviderImpl.processMgcpCommandEvent(JainMgcpStackProviderImpl.java:246)
at org.mobicents.protocols.mgcp.stack.TransactionHandler.receiveRequest(TransactionHandler.java:599)
at org.mobicents.protocols.mgcp.stack.MessageHandler.scheduleMessages(MessageHandler.java:196)
at org.mobicents.protocols.mgcp.stack.JainMgcpStackImpl.run(JainMgcpStackImpl.java:327)
.........

and from this point it displays similar java.lang.ArrayIndexOutOfBoundsException, but increasing the number (900 and 901 above) by 1 unit (i.e. 902, 903, 904, ...). Looking at org.mobicents.media.server.impl.clock.Scheduler, I found that there is an array named tasks, whose max lenght is 900. So, the array lenght is wrong or the media server has a problem creating threads.

How can I fix this trouble?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pipestradas
Offline
Joined: 2010-04-27

well, to solve this trouble, I added two conditions in 'execute' and 'run' methods, in Scheduler.java, to avoid java.lang.ArrayIndexOutOfBoundsException. I modified the Scheduler.java file from mobicents trunk.

The modifications are:

In 'execute' method, before line: timeline[0].tasks[timeline[0].pos++] = new LocalTask(task);
add:

In 'run' method, before line: timeline[milliseconds].tasks[timeline[milliseconds].pos++] = task;
add:

I also tried to solve it using Vector class, and it works, but I didn't test it to compare results with above source code. If somebody had the same problem and solved it in a distinct way, please post it.

Regards,

Felipe Estrada