BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-12-2009, 04:36 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question How to Debug from the JDE

Please Login to Remove!

I've never been able to run the debugger for my app. I just tried again today and failed with a JVM_Bind exception from the JDE when attaching to the simulator. I shut down practically every app I had running on my machine to avoid port conflicts but I still get the error. I tried changing the /data-port values on the fledge command line thinking that would help but it didn't. I tried attaching to the device which responded with a debugger attached white screen but the JDE would not stop on any break points. I'm only using the JDE for debugging as all of my dev/compile/packaging is done from IntelliJ and Ant build files using the RAPC cmd line. I can't even seem to build an acceptable cod file from the JDE. When I build from Ant and install on the device it doesn't hit break points. When I build from JDE (it compiles all the source ok) and install on the sim I get exceptions. Is there some cmd line jujitsu I can use to enable debugging from my IDE? I'm running OS 4.5.0 and I have the matching 4.5.0 simulator.
Offline  
Old 08-12-2009, 05:43 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Cliff,

This works "out of the box" - no fairy dust.

What JRE/JDK do you have installed?
Offline  
Old 08-13-2009, 08:19 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm using JDK 1.6. Now when you say out of the box, what do you mean? It's not as simple as connecting the remote debugger in my IDE to a port is it? To be fair, I've never used the JDE for any development and only experimented with attaching its debugger to the sim and to the device. My biggest question is whether or not special flags need to be set in RAPC to allow for debugging to happen. Here's my other big question. Does the Blackberry debugger use jdb like other Java apps?
Offline  
Old 08-13-2009, 08:28 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I believe that 4.5 requires 1.5, not 1.6

4.2 and lower requires 1.4

I would install 1.5 and make this your default JRE.
Offline  
Old 08-19-2009, 08:48 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Basic debugging problems

Maybe it's because I haven't done Blackberry in over a year. Whatever the reason I'm having the toughest time getting even simple things to work. I just tried creating a new workspace and project from scratch with the 4.5 JDE. I then added a simple HelloWorld midlet, just to see if I can get basic debugging to work. At first I couldn't get the midlet to even show on the home screen after building and running from JDE. I figured out that I needed to change the default project type from CLDC to MIDlet. That (along with specifying the midlet class) gets me to my next set of headaches. I initially specified the wrong class name for my Midlet. Then, after correcting the mistake, I hit build and run. That opened the debugger. The phone reported an attachment. Finally I started getting a bunch of error breakpoints hit eventually, (after 2-3 minutes) the device stopped at the white screen prompting a reset. Is there anything wrong with this source in the default package:
Code:
/*
 * HelloMidlet.java
 *
 *  <your company here>, 2003-2008
 * Confidential and proprietary.
 */

//package ;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloMidlet extends MIDlet {
    Form form;
    Command quit;
    
    protected HelloMidlet() {
        form = new Form("Hello Midlet");
        form.append("Hello Midlet World!");
        form.setCommandListener(new CommandListener(){
            public void commandAction(Command cmd, Displayable display)
            {
                try{
                    if(cmd == quit) {destroyApp(true); notifyDestroyed();}
                }catch (MIDletStateChangeException e) {}
            }
        });
        
        quit = new Command("Quit", Command.SCREEN, 1);
        form.addCommand(quit);
    }
    
    protected void startApp() throws MIDletStateChangeException {}
    
    protected void pauseApp(){}
    
    protected void destroyApp(boolean unconditional) throws MIDletStateChangeException
    {}
}
Offline  
Old 08-19-2009, 08:56 PM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile It's been too long!

I figured out my problem shortly after posting! In my frustration to force the broken code to run I neglected to reset my hack where I set the constructor from public to protected. Setting the constructor back to public (I also took the class out of the default package, not sure if it makes a difference) got rid of the errors. Since I'm working over remote desktop from a Mac to a Windows box I'll have to wait until I get into the office to test on device but I'm pretty confident that I finally have at least a basic solution!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.