BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-06-2009, 09:16 AM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: none
PIN: N/A
Carrier: hz
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with java app. on real BB device

Please Login to Remove!

Hi, all!
I wrote simple java application, that gets some data from servers's php-script. It works good in emulator, but when I try to get data from server on real device, it throws xxx8220;Uncaught exception: java.lang.NullPointerExceptionxxx8221;

I think, that there are some classes missed in my output *.jar file. How to include them in it? Or there is another problem?

Thanks

P.S. I'm using BlackBerry Java plug-in for Eclipse

Last edited by Hott Dogg : 04-06-2009 at 09:56 AM.
Offline  
Old 04-08-2009, 08:16 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i would suggest plugging in your real device, open it up in the debugger, and see just precicely where the exception is coming from. you'll be able to find the location and see if your theory is correct
Offline  
Old 04-08-2009, 09:22 AM   #3 (permalink)
New Member
 
Join Date: Apr 2009
Model: none
PIN: N/A
Carrier: hz
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Errors are in three last lines:

HttpConnection c = null;
InputStream is = null;
c = (HttpConnection)Connector.open(url);
is = c.openInputStream();
len =c.getLength();

Does anyone know how to fix?
Offline  
Old 04-08-2009, 03:30 PM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

it might be the case that you're using a BES or BIS parameter that is not suitable for your device connectivity. you'd have to say more about the url and your device's setup
Offline  
Old 04-08-2009, 03:39 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Are you sure your Blackberry is connecting to your web server? Also, try issuing a call to c.getResponseCode() to see what it is.
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.