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
Regular Contributor
Posts: 63
Registered: ‎08-30-2012
My Device: 9900

Preverify Error with net_rim_bbapi_adv_app.jar file

[ Edited ]

Hii

I've created a simple application that displays an advertisement. I used this article. I followed all steps but I get NoClassDefFound error on the BlackBerry 9900 simulator.i've downloaded the jar files from this url

 

For this I have used preverify.exe to check jar file to be compatible with net_rim_api.jar:

on my CMD:

preverify -classpath "D:\Eclipse\plugins\net.rim.ejde.componentpack7.1.0_7.1.0.10\com ponents\lib\net_rim_api" "net_rim_bbapi_adv_app.jar" "D:\Eclipse\plugins\net.rim.ejde.componentpack7.1.0_7.1.0.10\components\bin\output"
i am getting like this,what should i do?

Error preverifying class net.rimlib.blackberry.api.advertising.app.a
java/lang/NoClassDefFoundError: java/lang/Thread

 

Here my Code:

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
import net.rimlib.blackberry.api.advertising.app.Banner;

public class AdDemo extends UiApplication{
public static void main(String[] args)
{
AdDemo theApp = new AdDemo();
theApp.enterEventDispatcher();
}

public AdDemo()
{
pushScreen(new AdDemoScreen());
}

}

class AdDemoScreen extends MainScreen{

public AdDemoScreen()
{
Banner bannerAd = new Banner(16741, null);
bannerAd.setMMASize(Banner.MMA_SIZE_EXTRA_LARGE);
add(bannerAd);
}

}

 

How can I overcome this issue?

Thank you..

Developer
Posts: 673
Registered: ‎08-09-2010
My Device: Not Specified

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

Hello,

 

    Please find attachement.I hope this code usefull to you.

 

Thanks.

 

--------------------------------------------------------------------------------------------------------------------------------------------

feel free to press the like button on the right side to thank the user that helped you.

Regular Contributor
Posts: 63
Registered: ‎08-30-2012
My Device: 9900

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

can you able to execute this app from your side?

 

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

You do not need to preverify the jar.  All you need to do is include the jar in your build path and make sure you export the jar.  Here are the instructions you need:

http://docs.blackberry.com/en/developers/deliverables/40306/Setting_up_in_Eclipse_1355237_11.jsp#Add...

Regular Contributor
Posts: 63
Registered: ‎08-30-2012
My Device: 9900

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

Hi Peter

             i have followed the steps given in the documentation clearly,but still i am facing NoclassDeffound Error...what can i do?

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

What class is having the error?  In other words, what class is not found?

 

Did you Export the jar?  In other words did you tick the check box on the Order & Export tab of the Build Path?

Regular Contributor
Posts: 63
Registered: ‎08-30-2012
My Device: 9900

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

[ Edited ]

it is not showing any particulatr class name,when i execute the app,on the screen i am getting noclassdeffound error,i export the jar and i checked it correctly

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

When you debug this do you not see a class name?

 

Whereabouts in your code is this problem occurring.  We need to confirm that it is the add code that is causing the problem.

 

Do you see this problem on the SImualtor?

Regular Contributor
Posts: 63
Registered: ‎08-30-2012
My Device: 9900

Re: Preverify Error with net_rim_bbapi_adv_app.jar file

ya,i have used try catch blocks like this to catch an exception ,but i am not able to print the statement

 

class AdDemoScreen extends MainScreen{

try{

public AdDemoScreen()
{
Banner bannerAd = new Banner(16741, null);
bannerAd.setMMASize(Banner.MMA_SIZE_EXTRA_LARGE);
add(bannerAd);

}

catch(Exception e){

S.o.p("Error"+e.getMessage());

 


}

}

can you execute this demo app from your side and let me know   are you facing the issue or not?