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: 7
Registered: ‎04-29-2010
My Device: Various
My Carrier: Various

Cannot download more than 256 bytes via HTTP on Simulator

Hi,
I tried to install JAD/COD on simulator using a URL link to a JAD on my Apache 2.2 server via MDS simulator from JDE 5.0.0.
I got error:
"Error: Invalid manifest or application descriptor.
The "MIDlet-Name" attribute is missing".
 
Then I tried to download the same JAD file using HTTPDemo sample on simulator.
I got "0 bytes received"
 
Then I tried to download a plain text file.
 I found that when the text file has size 255 bytes or less,
it can be successfully downloaded using HTTPDemo on simulator.
 
But when I increased the file size to 256 bytes I got "0 bytes received".
 
So, results in simulator:
HTTPDemo get 255 bytes: OK
HTTPDemo get 256 bytes: Failed: "0 bytes received"
Browser get 255 bytes: OK
Browser get 256 bytes: Failed: empty window
 
Then I retested the same on a real BB device (8330m Sprint). I got:
HTTPDemo get 255 bytes: OK
HTTPDemo get 256 bytes: Failed: "0 bytes received"
Browser get 255 bytes: OK
Browser get 256 bytes: OK
 
I observed one difference: when I retrieve file of 255 bytes, Apache sends HTTP headers and payload
in the same TCP packet. But when I ask for 256 bytes, Apache sends HTTP headers in a separate
packet (marked as "[TCP segment of a reassembled PDU]) and the payload in the next packet.
This behavior does not violate HTTP protocol.
But in the failed cases the BB (or MDS simulator) closes connection right after the headers
and never receives the payload.
 
So, I am lost.
I cannot figure out whether the bug is in MDS simulator or BB HTTP implementation?
 
Thank you
 
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Cannot download more than 256 bytes via HTTP on Simulator

I haven't been able to reproduce this.  What BlackBerry smartphone simulator model and BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry smartphone simulator.

 

Can you provide a sample URL that triggers this behaviour?  Are you going through a proxy server?

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
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Cannot download more than 256 bytes via HTTP on Simulator

I'm not sure that I understand the problem symptoms here properly.  In one case you seem to testing text files, in another, a JAD file. 

 

To simppify things, can we look at one proglem at a time.  The one to start with appears to be the JAD file. 

 

I presume that you have updated Apache so that jad and cod files are sent with the correct MIME attribute?

 

Assuming tha is the case, what you seem to be saying is tha tthe Browser (and you are using the BlackBerry Browser I assume) on the SImualtor does not pick up the JAD file, so you get this error message "Error: Invalid manifest... " when you point your Browser at a downlaodable JAD file.  Is ths correct? 

New Contributor
Posts: 7
Registered: ‎04-29-2010
My Device: Various
My Carrier: Various

Re: Cannot download more than 256 bytes via HTTP on Simulator

Simulator version is 2.8.0.31.

Inside the simulator I tried to run various device/OS versions, such as 8120 4.3.0.59 and 9550 5.0.0.535

MDS is from JDE 5.0 or 4.7 (does not matter)

 

> Can you provide a sample URL that triggers this behaviour?

 

I am testing on a local machine, so I am using a local URLs, such as

http://192.168.0.99/255.txt

-> success

http://192.168.0.99/256.txt

-> failure

 

I can give you a routable URL to my home PC via a E-Mail, but I do not want to post it here.

 

>   In one case you seem to testing text files, in another, a JAD file.

 

I intentionally switched from JAD file to plain text file to avoid possible problem with MIME types.

 

Once the problem with plain text file is solved (for example if I switch from Apache to Tomcat),

then JAD file also loaded and installed successfully.

 

Thank you

 

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

Re: Cannot download more than 256 bytes via HTTP on Simulator

Does the problem only occur if the file is exactly 256 bytes?  Or does this happen with 256 and higher?

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: 7
Registered: ‎04-29-2010
My Device: Various
My Carrier: Various

Re: Cannot download more than 256 bytes via HTTP on Simulator

> Does the problem only occur if the file is exactly 256 bytes?  Or does this happen with 256 and higher?

 

Sure. I wrote "Cannot download more than 256 bytes".

I should have said "Cannot download more than 255 bytes"

 

As I explained, the difference is that Apache sends 255 byte payload

in the same packet as the HTTP headers. But 256 (and larger) payload

is sent in a separate packet.

 

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

Re: Cannot download more than 256 bytes via HTTP on Simulator

I've also been testing with Apache version 2.2 and haven't been able to reproduce this.

 

Please send me a PM with a URL to your sample files.  Thanks.

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