Error while running web service on blackberry simulator

佐手、 提交于 2019-12-05 21:18:48
Nate

Code Signing

As Th0rndike said, you don't need to sign code to run in the simulator, so that's not your problem (in the simulator).

Getting the Debugger Working Again

Also, if you're having trouble even setting breakpoints or stepping through your own Java source code, then:

  1. Inside the simulator, delete the application as you would on a normal device.
  2. Restart the simulator.
  3. Try running from Eclipse again. If it still doesn't work:
  4. Inside Eclipse, from the BlackBerry menu, choose Clean Simulator and then the JRE package whose simulator you're using (e.g. 5.0.0, 6.0.0, etc.)
  5. Try running from Eclipse again. If it still doesn't work:
  6. I would try reinstalling Eclipse and the BlackBerry Java plugin (together ... rather than installing a non-BlackBerry Eclipse IDE, and then adding the BlackBerry plugin separately). You can download the full Eclipse + BlackBerry plugin from this site.

Keep in mind that you will not be able to step into Java code that's part of the Java runtime, and RIM libraries. You do not have the Java source for those, only the binary libraries. So, if you have the line of code:

String s1 = "afdafsdasdf";
String substring = s1.substring(0, 10);  // <- can not step IN, can step OVER
MyWidget mw = new MyWidget();
mw.foo();                                // <- can step IN, or OVER

you would not be able to step into the second line, because substring(int,int) is not your code. But, you should be able to step into mw.foo() without seeing the "Source Not Found" errors, assuming MyWidget.java is one of your Java source files.

Finding Where Exceptions are Thrown

If you're running, and having trouble finding out where an uncaught NullPointerException (or other exception) is being thrown, see this answer. Basically, just put this debug code in your main program (e.g. MyApp.java):

public static void main(String[] args)
{
    try {
        Application theApp = new MyApp();
        theApp.enterEventDispatcher();
    } catch (Throwable t) {
        t.printStackTrace();
    }
}

And then, after the Throwable is caught, check the Eclipse Console window for stack trace information, showing where the exception came from. Then, debug again, trying to step into that code, and see what's wrong.

But, getting a functioning debugger is an absolute requirement for productive development. Don't bother with other problems until debugging works for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!