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: 112
Registered: ‎05-29-2009
My Device: Not Specified

Random NullPointerException

[ Edited ]

Hi,

      In my application i have to display the content of URL in the field. For that i am using BrowserField Demo provided by JDE samples.

 

      But while it is fetching the content means when the processing is going on, sometimes it throws the NullPointerException (Sometime InterruptedIOException also). This exception comes randomly. That means i can't find any special pattern when the excetion comes.

 

     Also when the applicaction is ruuning sometime the application hangs & it shows the NullPointerexception. my whole code is surrounded with try-catch.

 

     Can anyone tell me what should be the reason of these randomly coming exceptions?..

 

     Please help me to solve that..any help would be appreciated.

 

Regards 

Message Edited by JKDESAI on 07-08-2009 04:43 AM
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Random NullPointerException

Use EventLogger to catch the line (or several ones) that throws the exception.

 

Check RIM API javadocs for usage guidelines of this class.

 

Also use Throwable declaration instead of Exception declaration in try/catch structure.

 

"Throwable" declaration preserves exception info when an exception is thrown.

 

try {

 

 

} catch (Throwable th) {

         // log getMessage() value here

    

}

Developer
Posts: 112
Registered: ‎05-29-2009
My Device: Not Specified

Re: Random NullPointerException

Hi,

    I have replaced Exception argument in catch with Throwable. But still the application shows the exception. I don't know from where the exception is coming because flow never goes into a single catch statement.

 

    On the screen it is shown "JVM error 104 NullPointerException (or InterruptedIOException or RenderingException)". When we hit the continue, the further process is started & the content of the URL is displayed.

 

    Inshort, The content of the URL is shown anyhow with or without exception as i have told you that exception is generated randomly.

 

Any other suggession???...please...

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Random NullPointerException

Did you get a chance to see this thread.

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=3343&query.id=155...


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 112
Registered: ‎05-29-2009
My Device: Not Specified

Re: Random NullPointerException

Ya i saw that but i didn't get where to put "ignore-error=104".

 

I am using Eclipse for my application development. I have tried to put that after fledge.exe butgetting error.

 

Can you post me actual place & commands?..as i am running directly my application from eclipse, i dont know much more about using command prompt.

 

Sory if i am asking silly questions...

 

Regards...

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Random NullPointerException

In your Simulator folder, you will be having the 9000.bat for 9000 Simulator edit that and put the line "/ignore-error=104".

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 112
Registered: ‎05-29-2009
My Device: Not Specified

Re: Random NullPointerException

Hi......

 

I don't know what's going wrong with my application...but even ignoring the 104 JVM error it is also shown the same error & exceptios..& application stucks. I have tried that with putting that in eclipse run configuration->simulator->edit command also. But ignoring error doesn't effect a little.

 

My application is somewhat large & the displaying URL content is just a part of that which is invoked by menu click..

 

So do i need to set some browser configuration for that?...

 

Again i am saying that to display the URL content i am using browser field demo provided by JDE samples...

 

Regards