Skip to main content
GameDev.net gamedev.net
🔒 Locked

J2ME: getting exception's stack trace?

Started by pinacolada Jan 14, 2005 at 3:00 PM 1 replies 2.2k views
Original Post
pinacolada
pinacolada
I'm trying to get the stack trace out of an Exception on J2ME. Anyone know how to do this? Exception.printStackTrace() doesn't do it for me, because I need an actual String in order to display it (the bug only occurs when running on the phone, and I can't see System.err on the phone). Exception.toString() doesn't quite do it either, because that only gives me the type of exception, it doesn't give me the whole stack trace. Alternatively, if there was some way to redirect System.err, then that would work too. But so far all my attempts to do that have failed as well. Thanks!
Zahlman
Zahlman
What phone, and what sort of scenario causes the problem? It may be something someone around here has seen before...
shmoove
shmoove
On most phones this isn't possible. Some phones allow on-device debugging through SDKs (Sony Ericsson phones for instance) that allow you to redirect the error and output streams to the computer vie IR or Bluetooth. There is a symbian application that can also redirect the output streams to either a file, the network, or a console (the app is redirect.sis available for the P800/P900, but there might be ports for other Symbian flavours). There are a few other device specific tricks you might be able to do to debug on the devices themselves. But as a general rule, it's not possible.

shmoove

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.