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: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

BrowserFieldRequest: On device only; returns local connection timed out message.

So... This is how my day is going.

 

I have the following below when ran on a Bold 9700 device, I return the error message: "Error requesting content for: http://www.rim.com  Local connection timed out after ~ 130000."

 

However, on the simulator this issue does not appear.

 

I've tried to specify a different BrowserFieldConfig.USER_AGENT since I'm not using MDS and I've appended the "deviceside=true" suffix, neither fixed the issue.

 

Thoughts, suggestions?

 

 

public final class Browser extends MainScreen {
private BrowserField bf = null;
private BrowserFieldConfig bfc = null;
private BrowserContentManager bcm = null;
private String defaultUrl = "http://www.rim.com";

public Browser(final String url, final String title) {
	super();

	try {
		bfc = new BrowserFieldConfig();
		bfc.setProperty(BrowserFieldConfig.ENABLE_COOKIES, Boolean.TRUE);
		bfc.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
		bfc.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);

		bf = new BrowserField(bfc);

		if (url != null) {
			defaultUrl = url;
		}

		setTitle(title);

		BrowserFieldRequest request = new BrowserFieldRequest(defaultUrl);
		bf.requestContent(request);

		bcm = new BrowserContentManager(Manager.VERTICAL_SCROLL);
		bcm.add(bf);
		add(bcm);

	} catch (IllegalArgumentException e) {
		Logger.debug("[Browser] error: " + e);
	}
}

 

 

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
Developer
Posts: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

Re: BrowserFieldRequest: On device only; returns local connection timed out message.

I've stripped down the Class down to the following and I still get the same errors on the device, but not on the simulator.

 

What should I be doing here? I checked the Knowledge Base and pretty much C&V the code from there.

 

Any help with this issue is appreciated.

 

 

public final class Browser extends MainScreen {
private BrowserField bf = null;
private String defaultUrl = "http://www.rim.com";

public Browser(final String url, final String title) {
	super();

	try {
		if (url != null) {
			defaultUrl = url;
		}

		setTitle(title);
		bf = new BrowserField();
		add(bf);
		bf.requestContent(defaultUrl);

	} catch (IllegalArgumentException e) {
		Logger.debug("[Browser] error: " + e);
	}
}
}

 

 

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: BrowserFieldRequest: On device only; returns local connection timed out message.

[ Edited ]

Silly question I know, but does that URL work in the Browser on the device?

 

Also can you confirm the OS Levels involved.  I presume OS 5.0 for development environment and device. 

Developer
Posts: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

Re: BrowserFieldRequest: On device only; returns local connection timed out message.

Yes, I can type the url in the Browser on the device and it works; the page loads. I am targeting OS 5.0.0 and using a Bold 9700 device.

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
Developer
Posts: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

Re: BrowserFieldRequest: On device only; returns local connection timed out message.

I performed a debug on the device and nothing... went right pass an IllegalArgumentException and Exception condition.

 

I have to figure this out.

 

I can type the URLs directly in the device brower with no error and I've checked the KB, and I don't see anything that would prevent this to work correctly.

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
Developer
Posts: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

Re: BrowserFieldRequest: On device only; returns local connection timed out message.

Well something bad has happened to the device.

 

I compiled and loaded the RIM browerfield2demo unaltered and I receive the same error.

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
New Contributor
Posts: 8
Registered: ‎10-13-2011
My Device: 9330
My Carrier: Consultant

Re: BrowserFieldRequest: On device only; returns local connection timed out message.

Same thing here.. Any clues?

 

But it only happens when I select to use 3G Network. Using Wi-fi works just fine.

 

Regards,

Jose Faria