×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    1

    HTTP Connection on a Nokia 3650 - is it possible at all?

    I have a Nokia 3650 device from Cingular and I can not run my network aware application on it. My plan includes GPRS data, and I am able to send MMS content to E-Mail accounts.
    I created a really simple application in order to trace the problem, and I still get the same problem. The sample application is:

    HttpConnection c = null;
    InputStream is = null;
    try {
    c = (HttpConnection)Connector.open("http://www.sun.com", Connector.READ);
    is = c.openInputStream(); //<< Here I get a NullPointerException.
    ...

    I am getting a NullPointerException when I try to open the input stream. The strange thing is that the exception is thrown almost immediately, like the device does not even try to reach the server.

    Both my application and the sample run perfectly on the Nokia 3650 simulator.

    So my question is what could be the problem and how can I avoid it?

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    1
    Hi everybody,

    I've got the same problem as you. The same symptoms appears on the phone but not on the emulator.

    One indication on the server (a classical tomcat) is that the connection established is of type http 1.0 !!! I read everywhere that the midp1.0 requires the version http 1.1 I tested my application with others phones(Siemens and SonyErricson) and all is working well and the connections established are of type http1.1

    Is there someone that can provide me the info about the exact protocol used on the 3650?

    Thanks

    Laurent

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    1
    I found that the bug is apparently in the URL parsing. It seems there must be a trailing slash after the hostname when the path is empty. So in your example, try using the url:
    "http://www.sun.com/"
    instead of:
    "http://www.sun.com"
    This is a bug because the HTTP spec states that the two URLs are equivalent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×