I am developing a MIDlet to be run on
Nokia 6310i and I always get back
the IOException: invalid port when
making HTTP connection. Can anybody
explain why? HTTP should be supported
by MIDP 1.0.
Thanks,
Simon
I am developing a MIDlet to be run on
Nokia 6310i and I always get back
the IOException: invalid port when
making HTTP connection. Can anybody
explain why? HTTP should be supported
by MIDP 1.0.
Thanks,
Simon
Hello,
I took got same error but mine is pecuilar i am getting the response for first time but when making a second conneciton its giving this probelm.
Did u get the solution.
Hi,
The thing is that i got this error on my Series 40 Nokia 6610 mobile but it was running perfectly on the emulator.
my request URL is
first request is
http://202.63.107.106/frontend?UID=Login$1000000$spw1_1_1@yahoo.co.in$sfqatest$ROCKET$5
this was working fine
but second request is going for toss and request is
http://202.63.107.106/frontend?UID=GetMobileAlbums$1112315578084990:3f3a526d47a64:1000:spw1_1_1@yahoo.co.in:SFOSTG02$0
I get java.io.IOException:invalid port on the device.
I'm having the same problems on my 6280. I figured out what's it all about: having a colon ':' in your URL makes the phone think you're trying to set a specific port to connect to.
So try to replace the colons with something else and it will (most probably) work.
The same problem exists in gcalsync. I've suggested replacing : with %3a and that would hopefully help.
But Nokia ought to make sure this bug gets fixed. I upgraded to the latest firmware in my Nokia 5300 and the problem is still there.
Thank you for this thread, which helped me a lot. By the way, this issue is resolved in the Series 40 from late 2009 onwards. At least neither my Nokia 2710 Navigation Edition nor my Nokia X3-02 are affected. Previous models raised a NumberFormatException in com.sun.midp.io.j2me.http.protocol.parsePort (+66) which lead to lead to a IllegalArgumentException.Indeed, encoding the parameter values does help.
Another trick is to append a port within the authority.Then you can use the colon additional times.If you work with HTTP redirection and you want to stick to HTTP GET, make sure your server escapes its query parameters. Do not encode the whole query at once. Instead, encode each parameter-key and each parameter-value individually. Although this is not required by RFC 3986, it does not hurt. Otherwise you have to parse the whole URL in your MIDlet if you re-use a HTTP location header.Code:http://www.example.com:80/ https://www.example.com:443/
i still could'nt get it working.i have the same problem,in which the URL doesnt open for the second time.
Strange thing is that my URL does'nt have a ':' apart from "http : //" 's colon
java.lang.IllegalArgumentException: invalid port
at com.sun.midp.io.j2me.http.Protocol.parsePort(+93)
at com.sun.midp.io.j2me.http.Protocol.parseURL(+18)
at com.sun.midp.io.j2me.http.Protocol.connect(+46)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+64)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+8)
at com.sun.midp.io.InternalConnector.openPrim(+157)
at com.sun.midp.io.InternalConnector.open(+9)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+5)