How to get the text of an exception stack trace in Java ME?

前端 未结 5 1332
野的像风
野的像风 2021-02-15 13:20

In regular Java, you can get the text of a stack trace by passing a PrintWriter to printStackTrace. I have a feeling I know the answer to this (i.e. \"No\") but,

Is ther

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-15 14:06

    two solutions:

    • reproduce the exception on emulator. the wireless toolkit and Netbeans will print stack traces on your computer.

    • use a Symbian device.

    Prior to the Feature Pack 2 of Series 60 3rd edition, Symbian handsets use the Sun Hotspot java virtual machine. It was adapted to Symbian OS by linking it to a partial implementation of the C standard library.

    This allowed Symbian to create a C++ program called redirector, which was capable of capturing the VM standard output and standard error, including java exception stack traces.

    the c++ redirector was never upgraded for version 9 of Symbian OS. Instead, a "redirect://" GCF protocol was introduced into the VM,

    From a separate MIDlet, open an InputStream from the connection returned by Connector.open("redirect://", Connector.READ); you can then capture exception stack traces on Symbian phones.

    EDIT : "redirect://" is back in Series60 5th edition and "redirect://test" should work on Series60 3rd edition feature pack 2

提交回复
热议问题