Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 96
Registered: ‎03-06-2009
My Device: Not Specified

Breakpoints not working in netbeans

Hello,

 

I'm looking for the most effective way to debug my blackberry application, developed with JDE 4.2.1.

 

- I have tried eclipse but the plugin don't want to install

- I am using Netbeans but the breakpoints won't work

 

Not able to submit breakpoint LineBreakpoint ReportThread.java : 35, reason: No executable location available at line 35 in class com.ewee.sdf.client.connection.ReportThread. Invalid LineBreakpoint ReportThread.java : 35

 

 Any suggestion on the best solution? Thanks

 

Developer
Posts: 342
Registered: ‎02-04-2009
My Device: BB 8320

Re: Breakpoints not working in netbeans

I have got the thing working for me with the following setup in ECLIPSE:

 

1, Install the latest Java jdk 1.6.0_13

2, Install the latest eclipse version 3.4.2

3, Download the BlackBerry JDE Plug-in for Eclipse v1.0.0.67 version from  http://na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp

 

Run BlackBerry_JDE_PluginFull_1.0.0.67.exe to install the blackberry plugin for eclipse IDE. After that open your eclipse ide and following the steps as below:

 

1, Select Windows->Preferences, there you will see "BlackBerry JDE"

2, Select File->New->Project, you will see "BlackBerry" folder with two options as "BlackBerry Project" and "BlackBerry Resource File". Just select the "BlackBerry Project" option

3, If you want to import the already existing BlackBerry JDE projects into eclipse, then right click on the project menu on package explorer and in BlackBerry folder you can choose "Existing BlackBerry Projects into Workspace", then in the next screen you can select the project workspace file such as .jdp or .jdw to import the project

4, For choosing simulator: Select a project and select Run->Run Configurations->BlackBerry Simulator->DebugServer, there select the "Simulator" tab, there you can select the Profile such as, 8300-IDE, 8830-IDE etc., If you can't find a particular profile eg., 9530-IDE, then download the component pack associated for that profile.

 

Now you can start coding your application and running the same, which will open in the configured profile in the simulator. 

 

No idea about the setup in Netbeans IDE! 

 

This may help you :smileyhappy: 


Use Search. "Accept Solution" if the problem gets resolved.
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Breakpoints not working in netbeans

Since there is no support for NetBeans officially, we would suggest you to use Eclipse(with plugin) or JDE..

 

Thanks! 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 96
Registered: ‎03-06-2009
My Device: Not Specified

Re: Breakpoints not working in netbeans

While the application was debugging fine in Netbeans, here I get the following error while lauching it in eclipse.

The simulators does launch itself but when I click on the application icon it freezes and I get this in the console:

 

 

Module 'BlackberryClient' has verification errors.Error starting BlackberryClient: Module 'BlackberryClient' has verification errors.

 

 I also noticed this error during the launch

 

 

Module 'ksoap2-j2me-core-prev-2.1.2' not found.Error starting OasBlackberryClient: Module 'ksoap2-j2me-core-prev-2.1.2' not found.

 ksoap is a jar which has been added to the classpath so I don't get why it's not working.

 

Do you have any idea how to solve this? Thanks

 

 

 

Developer
Posts: 71
Registered: ‎03-10-2009
My Device: Not Specified

Re: Breakpoints not working in netbeans

Could you tell me in a few words how did you make it debug in netbeans? Reading your post I just retried it (I have never succeeded before). I can launch the emulator in debug mode and also connect to the device, after doing so netbeans will connect to the JDWP agent (the device will show 'Debugger attaching...' for a while), netbeans will show the running threads it can even suspend them, but no break points or any other ways to interact with the running application(s).

 

I used to think that I should be able to connect to a running emulator (th JDWP agent even says something like this on the Communications tab), but it mever worked for me. Now I can attach, but can't do anything apart from what I described above.

Developer
Posts: 96
Registered: ‎03-06-2009
My Device: Not Specified

Re: Breakpoints not working in netbeans

Sorry, I meant the debug was launching, but as specified in my first postm the breakpoints couldnt work.

 

Any help for my eclipse error?

Developer
Posts: 71
Registered: ‎03-10-2009
My Device: Not Specified

Re: Breakpoints not working in netbeans

I don't know about eclise, nor do I want to use it until NetBeans will be shut down due to the IBM acquisition Smiley Happy, but looking at your error message above... Adding a jar file to the classpath of eclipse has nothing to do with the emulator. The kxml jar (or actually the classes you use from it) should be bundled with your application (i.e. they should make their way into the COD file). It may sound too generic, but I don't know how you build your app. If you use eclipse for that, then check the settings there. I use ant (called from within netbeans) and package the needed classes together with proguard.
Developer
Posts: 96
Registered: ‎03-06-2009
My Device: Not Specified

Re: Breakpoints not working in netbeans

I do have ant.

Can you tell me how you bundle to the librairies?

Developer
Posts: 71
Registered: ‎03-10-2009
My Device: Not Specified

Re: Breakpoints not working in netbeans

First of all really prefer using ant because it will allow you to distribute and build your project without an IDE and a 10 page long description of hot to build it. But if you're already using eclipse/JDE plugin you might want to have a look at that for an easier (but dirtier solution). Another benefit of using ant is that you can create a reusable build script and from that point on it will be even easier than setting up a project in an IDE.

 

If I didn't deter you yet Smiley Happy... I use proguard (->google) which is an obfuscator but also will pack a set of class and jar files into one (or more) optionally leaving out what's not needed. This is called 'shrinking' and will strip unused classes as well as unsused methods (from classes that you use otherwise).Here is a snippet frommy build template that does this:

        <mkdir dir="${build.obfuscated.dir}" />
        <proguard shrink="${obfuscate.shrink}" printmapping="${build.dir}/main.map"
            obfuscate="${obfuscate.obfuscate}" usemixedcaseclassnames="off"
            optimize="${obfuscate.optimize}" ignorewarnings="on" defaultpackage="">
            <libraryjar refid="bootclasspath"/>
            <injar refid="classpath"/>
            <injar name="${build.classes.dir}"/>
            <outjar name="${build.obfuscated.dir}/obfuscated.jar"/>
            <keep extends="net.rim.device.api.system.Application">
                <method name="main"/>
            </keep>
            <keep extends="net.rim.device.api.ui.UiApplication"/>
        </proguard>

 

It will create a jar file called obfuscated.jar in the build directory. This should be done before the preverification (though proguard can be configured to preverify, but I haven't changed my build script yet). The next step is to extract the JAR for preverification and copying in the resource files (I find this easier than adding them to the existing ZIP). This is important to do it like this, because proguard can also take a directory as its output but if you provide JARs as the input (at least one) then it will emit one output jar for one input jar and it's not what you want.

 

So after that you unpack, preverify, copy the resources, jar again and then call rapc on the resulting jar.