BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-21-2010, 08:54 AM   #1 (permalink)
New Member
 
Join Date: Apr 2010
Model: 9630
PIN: N/A
Carrier: airtel
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting JVM error 104 - uncaught null pointer exception

Please Login to Remove!

Hi friends. After a wide search i got a sample code for calling amazon web service which is as follows



public void obtenerArticuloSOAPYahoo(String id) {

HttpTransport ht = null;
SoapSerializationEnvelope envelope = null;
try
{
SoapObject rpc =
new SoapObject("urn:PI/DevCentral/SoapService", "KeywordSearchRequest");


SoapObject ro = new SoapObject("urn:PI/DevCentral/SoapService", "KeywordRequest");

ro.addProperty("keyword", "dog");
ro.addProperty("tag", "webservices-20");
ro.addProperty("type", "lite");
ro.addProperty("mode", "book");
ro.addProperty("page", "1");
ro.addProperty("devtag", "your-dev-tag");

rpc.addProperty("KeywordSearchRequest", ro);

new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.bodyOut = rpc;

ht = new HttpTransport("h t t p ://soap.amazon.com/onca/soap3");
ht.debug = true;

ht.call("h t t p ://soap.amazon.com/onca/soap3", envelope);

System.err.println ("call" + ht.responseDump);
SoapObject result = (SoapObject) envelope.getResult();
}
catch (SoapFault f)
{
System.err.println( ht.requestDump );
System.err.println( ht.responseDump );
System.err.println( f.faultstring );

}
catch (Exception e)
{
System.err.println(" excep::req::" + ht.requestDump );
System.err.println(" excep:resp:" + ht.responseDump );
//System.err.println( e.faultstring );

}

}



but when i run it i get the exception....Getting JVM error 104 - uncaught null pointer exception .. I am a beginner to this blackberry world. Please help..
Offline  
Old 04-21-2010, 10:08 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Are you running this on the simulator, using the debugger?

If so, can you please do a little problem determination, and identify the line where the NPE is thrown?
Offline  
Old 04-22-2010, 03:48 AM   #3 (permalink)
New Member
 
Join Date: Apr 2010
Model: 9630
PIN: N/A
Carrier: airtel
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I reached a stage where i didnt get any exceptions. But in the debugging mode i
get these messages


FocusHistory: Focus gained; App AMAZON; Component net.rim.device.api.ui.component.ButtonField
SHUTTING DOWN SIM SERVER
Exit net_rim_bb_simphonebook(121)
Refreshing connection on send
Running refresh
Local port: 19780
APN: 'rim.net.gprs'
APN username: 'null'
APN password: 'null'
Connection does not exist
Detected information for 1 GPAK connection(s)
JVM: bklt @10750: timer
JVM: bklt @10753: idle 14
JVM: bklt @10754: setTimer 8




WHAT IS WRONG ?? ANY1 HELPPPP
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.