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
New Contributor
Posts: 3
Registered: ‎04-20-2011
My Device: Developer
My Carrier: AT&T

Random application crash when using BrowserField

Hello to everyone.

This is my first post on the forum, but I've been reading and learning from it for the past couple month while working on the BB application. So far I've found answers on all my questions but now came across the problem that I can't  resolve or find related info for:

 

My application uses BrowserField control to display purchase page (php, javascript) where user fill in information. After page is submitted some processing occurs on the server side and success/failure page is returned and displayed in the BrowserField. The issue is that 70% of the time after page is submitted I'm receiving the error message: "Uncaught exception: Application xxx is not responding; process terminated" and application gets shutdown. I know that submitted transaction does go through as I'm receiving confirmation emails on it but for the sake of me I can't figure out why OS is shutting down the app. I know it has nothing to do with processing time that page takes as control handles it without problems (have built test pages that takes way longer then this one to load), or ssl certificate issues. Also, for the remaining 30% percent I'm getting success page back... I'm using test purchases so submitted information is always the same.

 

So far I've tried error handling in every routine, custom error handler on browserfieldconfig, custom debugger (I know it depreciated in 6.0 but...), moving Screen on it's own Thread... There is nothing in log files, eclipse debug console or anywhere else I tried to look that tells me what's causing it. My browserfield code came from browserfield2demo (with modifications):

 

BrowserFieldConfig config = new BrowserFieldConfig();
config.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
config.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
config.setProperty(BrowserFieldConfig.ENABLE_COOKIES, Boolean.TRUE);
config.setProperty(BrowserFieldConfig.JAVASCRIPT_TIMEOUT, new Integer(50000));
MyBrowserFieldErrorHandler eHandler = new MyBrowserFieldErrorHandler(browserField);
config.setProperty(BrowserFieldConfig.ERROR_HANDLER, eHandler);
browserField = new BrowserField(config);

BrowserFieldListener listener = new BrowserFieldListener()

browserField.addListener( listener );

 

I've tried it using it browserfield2demo code and got the same result

 

Aplication is built in BB Eclipse plugin (JRE 6.0.0) target BB9800 (OS 6.0), i'm using both simulator and live device - 6.0 Bundle 695 (v6.0.0.246 Platform 6.4.0.105) for testing.

 

Here is what I can see in Eclipse debug console immediately after submit button is clicked on the page:

 

SSL:->CH
SSL:<-SH
SSL:<-SC
SSL:<-SKE
SSL:<-SHD
SSL:->CKE
VM:NCICv=29
VM:NFICv=1
VM:NFICv=2
VM:NFICv=3
SSL:->CCS
TLS:->F
TLS:<-F
VMSmiley TongueISVt=0,h=2f75,id=d15a33128dfbb5d9
VM:LNTDa=commit,t=1,p=xxxxxxx,h=2
Application xxxxxxx(251) is not responding; process terminated
[0 2]
4 100000fb
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
0 2
VM:THMNx=191,r=0x155A2000,t=net.rim.vm.MessageQueue
VM:THMNx=2,r=0x12ECB800,t=net.rim.device.cldc.io.devicehttps.ClientProtocol
VM:THMNx=191,r=0xF4ED400,t=java.lang.Object
VM:THMNx=191,r=0x10E9E400,t=net.rim.vm.Message
VM:THMNx=2,r=0x10E9E800,t=java.lang.Object
VM:THDRr=native
VM:THDLv=0
VMSmiley Very HappyPNAh=2,o=0xC00C800,p=xxxxxxx
AM: Exit xxxxxxx(251)
ApplicationManagerImpl.processExited : process process switching to background:  pid=251
AM: Foreground is requested: net_rim_bb_ribbon_app(90)
Process xxxxxxx(251) cleanup started
Process xxxxxxx(251) cleanup done
TID:unable to execute in the app com.kgbkgb.xxxxxxx.xxxxxxx@f2821fa2|java.lang.Object@77cb23e6|-1
FocusHistory: Focus gained; App xxxxxxx; Component net.rim.device.apps.internal.browser.olympia.common.NavigationNodeOlympiaField$NodeFocusField
FocusHistory: Focus lost; App xxxxxxx; Component NULL
FocusHistory: Focus gained; App net_rim_bb_ribbon_app; Component net.rim.device.api.ui.component.ButtonField
AM: Foreground is set: net_rim_bb_ribbon_app(90)
ApplicationManagerImpl.setForegroundProcess : calling notifyApplicationSwitch to switch to foreground: process=net_rim_bb_ribbon_app(90) pid=90

 

 

Any advice would be greatly appreciated as we getting into crunch time and without this working reliably...

New Contributor
Posts: 3
Registered: ‎04-20-2011
My Device: Developer
My Carrier: AT&T

Re: Random application crash when using BrowserField

Bump. Anyone?

I was able to recreate the problem by simply building a landing and status pages, and adding timer to status page to hold processing for 30 sec. After timer kicks in page is sent to the device. I took browserfield2 demo and sent the request to the page 1. After submitting it, at exactly 10 seconds i received "Uncaught exception" message and app shutdown. Tried the same with the browser and it worked as expected, waiting for 30 seconds and displaying the status  page. If i change timer under 10 seconds, everything works perfectly.

 

Any ideas????? 

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Random application crash when using BrowserField

What BlackBerry Smartphone model and BlackBerry device software version are you testing on? You can find this under Options, About on the BlackBerry Smartphone.

Can you provide a link to or the source of the sample page that triggered this?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Contributor
Posts: 3
Registered: ‎04-20-2011
My Device: Developer
My Carrier: AT&T

Re: Random application crash when using BrowserField

Torch 9800

 

Actually, I figured this one out (at least it's working for me now) - created requesthandler class that implements    BrowserFieldNavigationRequest and BrowserFieldResourceRequestHadlers. in handleNavigation() routine called browserField.displayContent from within new thread. Now it wait's as long as web page takes and I can catch any connection errors

Let me know if there is any better way to achieve it, but if you add this code to browderfield2demo works like a charm.