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 Developer
dinesh
Posts: 6
Registered: ‎10-04-2008
My Device: Not Specified

Midlet HttpConnection Problem

Hi

 

I have developed a midlet application which is working fine on Blackberry Simulator and other non blackberry Models.

 

But when I run it on real device it hangs up as it's not able to open HttpConnection.

 

I have tried many things such as:-

 

1. appending    ;deviceside=true and      ;deviceside=false   to the url.

2. I have done APN settings . I have "Airtel India" data plan.  APN: airtelgprs.com and Username/Password : blank

 

 My Blackberry Model is BlackBerry 8700g

 

Any idea what else I can do.. Please help

 

Please use plain text.
Administrator
MSohm
Posts: 14,310
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Midlet HttpConnection Problem

What happens when you try to make the connection?  Is an exception thrown?  If so, what is it?  Or does the application hang?  If so, please see this link.

 

Support - Application stops responding when opening a connection
Article Number: DB-00159

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/Support...

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
Please use plain text.
New Developer
dinesh
Posts: 6
Registered: ‎10-04-2008
My Device: Not Specified

Re: Midlet HttpConnection Problem

My application just hangs.

 

I don't get any exception.

 

I display a progressbar in the main thread and  spawn a separate thread to make Htpconnection to bring data from the server. After this my application stucks on the progress bar screen .

 

I receive a dialog box informing me that application is going to make an Httpconnection when I press "Allow" application stucks on the progressbar screen.

 

I have changed security permissions also and allowed everything.

 

I have no clue what I try next. Please help.

Please use plain text.
Administrator
MSohm
Posts: 14,310
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Midlet HttpConnection Problem

What line of code is your application blocking on?  Is any exception thrown?
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
Please use plain text.
New Developer
dinesh
Posts: 6
Registered: ‎10-04-2008
My Device: Not Specified

Re: Midlet HttpConnection Problem

My application is able to open the connection , create the outputstream, write bytes on the ouptutstream, close and flush the outputstream.

After this when I try to open the inputstream on the same connection(just after flushing the outputstream) application hangs.

 

No exception is thrown it just hangs.

 

Please use plain text.
New Developer
dinesh
Posts: 6
Registered: ‎10-04-2008
My Device: Not Specified

Re: Midlet HttpConnection Problem

When I attach my device to JDE debug I get following prints.( I just came to know this method of debugging in blackberry)

 

 

Opening connection::::::
CMM: BlackBerry$2d4$2e2TrackBall$2den_US$2dDLFBB(4323) no sig from 0x33   (--Does this line indicate something as this is not System.out.println)
Opening connection::::::
Opening connection1380974net.rim.device.cldc.io.waphttp.WAPRequestImpl@84e6e951
outStream::net.rim.device.cldc.io.http.HttpOutputStream@f71423d4
written  outStream::
opening inStream         (--After this no System.out.println appears.)

No stack trace
JVM: bklt @23302: timer
JVM: bklt @23304: idle 2
JVM: bklt @23305: setTimer 13
GME Rx Cid: IPPP
GME Rx Cid: IPPP
JVM: bklt @24969: timer
JVM: bklt @24971: idle 15
JVM: bklt @24972: setTimer 15
GME Rx Cid: IPPP
JVM: bklt @26893: timer
JVM: bklt @26894: idle 15
JVM: bklt @27174: setTimer 15
VM:+GC(F)w=11
VM:-GCt=51,b=1,r=0,g=1
VM:+CR
VM:-CR=28
JVM: bklt @29095: timer
JVM: bklt @29097: idle 15
JVM: bklt @29098: setTimer 15
JVM: bklt @31018: timer
JVM: bklt @31020: idle 15
JVM: bklt @32232: setTimer 15
JVM: bklt @34152: timer
JVM: bklt @34153: idle 15
JVM: bklt @34155: setTimer 15
VM:IGCSc=0

 

 

 

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Midlet HttpConnection Problem

Normally in these cases, besides posting the code pieces which tend to be short and about the same in most cases,

I'd suggest trying to look at the server and find out what it actually sees - does it get a complete request, does

it send a response? The BB code is usually quite simple but there are a lot of changes in the data, things in the

network path, and idiosyncracies of servers that can make for confusing results. Do you have access to the server or

can you redirect your request to a dummy server and just make sure you are getting a request to which a response can be made?

Packet capture can help too if the simple approach doesn't work and there are no obvious problems in the BB code.

 

Please use plain text.