当前位置: 动力学知识库 > 问答 > 编程问答 >

java - sony ericsson JP-7 j2me debugging

问题描述:

I'm trying to debug a J2ME application on my Sony Ericsson K790i which is a JP-7 phone on a Windows XP with latest Netbeans, J2ME SDK, Sony SDK, etc.

I can USB connect and use the SE Device Explorer. When I start my app from device explorer, it just gives a exception name (ArrayOutOfBoundsException) and a call stack with a list of "unknown". Is there a way to translate the call stack into procedure and line #? Is there a way to create a debug binary or any way to get a little more hints?

My app is starting fine on the emulator. It even installs fine on phone but when I run it, it crashed with no info at all.

I have tried even to use On Device Debug which my phone supports but I get a OAFcode=45 EXEcode=28 and debug session never starts. Though it does create a tempNNNN app in my phone.

Any ideas that could help are welcome.

网友答案:

When you get an exception with unknowns in the callstack the exception is coming from the Java runtime environment. Due to the limited flash space on SE OSE phones most debug info is stripped. It is possible to get the addresses of the callstack (it is transmitted over the wire but mapped to 'unknown' by DeviceExplorer) but it would not do you much good since you dont have a address map to translate the addresses.

IIRC there is a text document describing the different error codes included in the sdk. Look for oafcodes.txt or something like that.

Also, if you're using Netbeans: When you create new projects in Netbeans I believe it defaults to MIDP 2.1. K790 is a old phone and it only supports 2.0. Pre MIDP 2.1 SE phones will just barf if you try to install 2.1 applications on it.

网友答案:

If you are able to see the exception then you will see all the stack trace if you print it and you will identify why and where is the problem. May be, when you've been deployed/builded your application to your phone you have the compiler properties used by the debugger disabled (ex: add line number attributes, etc)?

I don't know what does it means the list of "unknown" exceptions.

Normally you can see in the full stack, the exception raised, class method and line that causes the issue.

By the way, did you try to use KDWP? It seems a great solution. In this tread the people talks about debugging on a device.

分享给朋友:
您可能感兴趣的文章:
随机阅读: