Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Revenge
Posts: 9
Registered: ‎02-24-2009
My Device: Not Specified
Accepted Solution

Application crashes with Exception when using javax.microedition.media.Player

Hi,

 

   I have an application that processes data from bluetooth and send it to the web service. Recently there was a request to add sounds to the application. Now when the application processes batches of data and the player is playing constantly after a few secs I get "Application is not responding" exception. And then the process is terminated. In the logs I can see lots of ForcedStackTrace exception logged after this exception.

   The sounds are played in the separate thread. If app doesn't play sounds or plays short sounds - everything works fine. Is there any way to avoid this exception happening? Why is it happening?

 

Thanks in advance,

Viktor. 

Please use plain text.
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Application crashes with Exception when using javax.microedition.media.Player

I suggest you attach the debugger to your BlackBerry and see what causes the event queue of your app to fill up. Alternatively, download the Event Log using JavaLoader -u eventlog, then analyze the information contained in the ForcedStackTraceExceptions and locks held (see http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=59424 for some ideas).
Please use plain text.
New Developer
Revenge
Posts: 9
Registered: ‎02-24-2009
My Device: Not Specified

Re: Application crashes with Exception when using javax.microedition.media.Player

Unfortunately I do not use JDE to develop the application - I use eclipse. Also I examined the stack trace elements and here are some of the names of module:
net_rim_cldc-14 ,4, 11, 10,

net_rim_cldc_io_rim_imp

and other net_rim libraries related to media,internet connection.

I doubt that the application produces the deadlock as everything works fine until I use the Player.

If the player thread works and plays long melodies one after another I get an exception. The are no memory leaks as if the data is processed in one-by-one fashion sounds get played and everything works fine. App crashes only when the load of data is considerably big.

Please use plain text.
New Developer
Revenge
Posts: 9
Registered: ‎02-24-2009
My Device: Not Specified

Re: Application crashes with Exception when using javax.microedition.media.Player

Resolved by implementing my own PlayerManager, which, running in a separate thread would play the item in the queue manner rather then having many threads using the inner Player implementation.
Please use plain text.