BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-06-2009, 01:26 AM   #1 (permalink)
New Member
 
Join Date: May 2009
Model: 9000
PIN: N/A
Carrier: Trigcom
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default MDS caching

Please Login to Remove!

We have just started porting of a Java ME application. The Java ME application communicates with a server by using HTTP POST messages. We use the JDE 4.6 with the corresponding MDS which proxy our POST messages to the server. Unfortunately not all messages are received by the server and sometime the client get a 404 response:

My debug log in JDE:

Code:
...
05-06 04:53:14 [DEBUG] no.mbricks.net.transport.http.HTTPClientTransport - Connection got response code: 200
05-06 04:53:14 [INFO] no.mbricks.net.transport.http.HTTPClientTransport - Receiving 42 bytes from the network
05-06 04:53:14 [DEBUG] no.mbricks.net.protocol.Protocol - Data received in protocol with length: 42
05-06 04:53:14 [DEBUG] no.mbricks.net.protocol.Protocol - Packet received from client 0
05-06 04:53:14 [DEBUG] no.mbricks.net.protocol.Protocol - Packet size: 42
05-06 04:53:14 [DEBUG] no.mbricks.net.protocol.Protocol - Getting packet type
...
05-06 04:53:14 [INFO] no.mbricks.framework.net.PlatformMessage - Sending PlatformMessage
05-06 04:53:14 [DEBUG] no.mbricks.net.transport.Transport - Sending keepAlivePacket
05-06 04:53:14 [DEBUG] no.mbricks.net.transport.Transport - Sending packets 48
05-06 04:53:15 [DEBUG] no.mbricks.net.transport.http.HTTPClientTransport - Connection got response code: 404
05-06 04:53:16 [DEBUG] no.mbricks.net.transport.Transport - Sending keepAlivePacket
...
In the MDS log I find:

Code:
...
<2009-05-06 06:53:14.175 CEST>:[189]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, ERRORMSG = Invalid, DEVICEPIN:CONNECTIONID = 2100000a:1534984737, SEQUENCE =
1, Information = Received Packet for a timed out connection>
...
My question is: Do anybody know if there is some kind of caching in the MDS that would stop similar client requests from getting to the end server?

Is there any explanation about the 404 error?
Offline  
Old 05-06-2009, 09:46 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

Have you tried a direct TCP connection from the simulator? This bypasses the MDS-CS proxy and might help you isolate the issue.

MDS does proxy and cache everything - it is very aggravating sometimes.

Make sure you have something like this in your HTT header properties:

httpConnection.setRequestProperty("If-Modified-Since", "29 Oct 1999 19:43:31 GMT");
Offline  
Old 05-07-2009, 03:19 AM   #3 (permalink)
New Member
 
Join Date: May 2009
Model: 9000
PIN: N/A
Carrier: Trigcom
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default MDS stopping HTTP POSTs

I open my HTTP connection like this:

Code:
HttpConnection connection = (HttpConnection) Connector.open(URL+URI, Connector.READ_WRITE);
connection.setRequestMethod(HttpConnection.POST);
connection.setRequestProperty("Content-Type", "application/octet-stream");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("Cache-Control", "no-cache");
connection.setRequestProperty("Pragma", "no-cache");		
connection.setRequestProperty("If-Modified-Since", "29 Oct 1999 19:43:31 GMT");
I see that the MDS gets the POSTs, but it simply does not send it to the server on the other end!

From MDS log:
Code:
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION =>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = [Transmission Line Section]:>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = POST /SuperOfficeServer/servlet HTTP/1.1>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = [Headers Section]: 8 headers>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = Content-Type:application/octet-stream>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = Pragma:no-cache>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = Connection:Keep-Alive>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = Cache-Control:no-cache>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = x-rim-conttime:10000>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = If-Modified-Since:fr, 29 okt 1999 19:43:31 GMT>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = Host:85.19.158.214:8180>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = Content-Length:16>
<2009-05-07 09:16:33.441 CEST>:[1001]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVICEPIN = 2100000a, CONNECTION
ID = 340565671, HTTPTRANSMISSION = [Parameters Section]: 0 parameters>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION =>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = [Transmission Line Section]:>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = POST /SuperOfficeServer/servlet HTTP/1.1>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = [Headers Section]: 11 headers>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = Connection:Keep-Alive>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = x-rim-original-accept:*/*>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = Accept:*/*>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = Content-Length:16>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = Pragma:no-cache>
<2009-05-07 09:16:33.480 CEST>:[1002]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN = 2100000a, CONNECTIONID = 3
40565671, HTTPTRANSMISSION = Cache-Control:no-cache>
Offline  
Old 05-07-2009, 08:14 AM   #4 (permalink)
New Member
 
Join Date: May 2009
Model: 9000
PIN: N/A
Carrier: Trigcom
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

In debugger I see that it never returns from this method.

Code:
is = connection.openInputStream();
After a while it gets interrupt exception. The server dosen't get a POST either.
Offline  
Old 05-08-2009, 03:11 AM   #5 (permalink)
New Member
 
Join Date: May 2009
Model: 9000
PIN: N/A
Carrier: Trigcom
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem solved!

I found that the MDS was caching my response object. To prevent this I had to specify:

Code:
// Prevent response from being cached by a proxy server
response.addHeader("Pragma", "No-Cache");
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.addHeader("Cache-Control", "pre-check=0, post-check=0");
response.setDateHeader("Expires", 0);
Anybody knows the reason from why the MDS is caching response objects?
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.