BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-20-2009, 04:39 AM   #1 (permalink)
New Member
 
newbie_bb's Avatar
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: simulator
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default JVM Error 104 Uncaught: Runtime exception ..

Please Login to Remove!

Hi All,

I am facing a very strange problem. I am trying to make a horizontal tab at the top of the screen. When i run the program at simulator 8300. i get the following error

JVM Error Uncaught: Runtime Exception
Scroll for available commands.
Continue


After scrolling i get the following change in the above green text "Reset" and after that "Attach Debugger". Clicking the button on "Attach Debugger" case. I used to get as follows screen

Debugger Attach Failed
Scroll for available commands
Continue

When i click in continue case i get the program i made.

Please let me know what is going on. I am not able to point the problem in program.
What may be the possible reason for this behavior.

Below is the Screen code i am using.

Code:
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FocusChangeListener;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;


public class LandingScreen extends MainScreen implements FocusChangeListener
{
	//LabelField mostPopular = new LabelField("Most Popular",Field.FOCUSABLE|Field.FIELD_LEFT|Field.HIGHLIGHT_FOCUS);
	private LabelField mostPopular;
	private LabelField newlyAdded;
	private LabelField allCategories;
	private LabelField spacer1;
	private LabelField spacer2;
	public LandingScreen()
	{
		HorizontalFieldManager topTabManager = new HorizontalFieldManager();
		mostPopular = new LabelField("Most Popular",LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT);
		newlyAdded = new LabelField("Newly Added",LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT);
		allCategories = new LabelField("All Categories",LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT);
		spacer1 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
		spacer2 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
		
		mostPopular.setFocusListener(this);
		newlyAdded.setFocusListener(this);
		allCategories.setFocusListener(this);
		
		topTabManager.add(mostPopular);
		topTabManager.add(spacer1);
		topTabManager.add(newlyAdded);
		topTabManager.add(spacer2);
		topTabManager.add(allCategories);
		add(topTabManager);
	}
	public void focusChanged(Field field, int eventType)
	{
		Dialog.alert("field ="+field+" eventType="+eventType);
		/*if(eventType == FOCUS_GAINED)
		{
			if(field == mostPopular)
			{
				Dialog.alert("mostPopular!");
			}
			if(field == newlyAdded)
			{
				Dialog.alert("newlyAdded!");
			}
			if(field == allCategories)
			{
				Dialog.alert("allCategories!");
			}
		}*/
		//Dialog.alert("mostPopular!");
		
	}
	public boolean onClose()
	{
		Dialog.alert("Goodbye!");
		//NewScreen pScreen = new NewScreen();
        //UiApplication.getUiApplication().pushScreen(pScreen);
		System.exit(0);
		return true;
	}

}
Code calling the Screen

Code:
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.container.MainScreen;

public class HelloWorld extends UiApplication
{
	public static void main(String[] args)
	{
		try
		{
			HelloWorld hello = new HelloWorld();
			hello.enterEventDispatcher();
		}
		catch (Exception e)
		{
			System.out.println("Message from main "+e.getMessage());
		}
	}
	public HelloWorld()
	{
		try{
			//display a new screen
			pushScreen(new LandingScreen());
		}
		catch (Exception e)
		{
			System.out.println(e.getMessage());
		}
	}
}
__________________

Thanks,
Regards,
Amber
Offline  
Old 08-21-2009, 04:16 AM   #2 (permalink)
Thumbs Must Hurt
 
shraddha294's Avatar
 
Join Date: Oct 2007
Location: Hyderabad
Model: 8800
PIN: N/A
Carrier: TMobile
Posts: 111
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't yet have a solution to your problem.
The code looks like a perfect piece of logic that should work.

The runtime exception is occuring when the horizontal manager is getting added to mainSCreen i.e. when we do add(topTabManager);
I don't know why this should happen, will debug it further as time permits.
Offline  
Old 08-23-2009, 09:50 AM   #3 (permalink)
New Member
 
newbie_bb's Avatar
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: simulator
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Shraddha .....

Even this support is good for a new person .....

I am also trying. If i get something, will definitely let you all know...
__________________

Thanks,
Regards,
Amber
Offline  
Old 08-24-2009, 02:30 PM   #4 (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

Check your compiler version. I just replied in another thread regarding verification errors. You'll find the a lot of these weird Runtime errors come from using the wrong version of RAPC. In case you don't know, RAPC is what is used to compile your code. If you're loading from a Jar/Jad you'll get better results by passing these files to RAPC. If you are using the JDE, which comes with RAPC, check the version that you're running and make sure its earlier or equal to the version of your device. I know these errors well after killing the better part of several months fighting them.
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.