Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

J2ME network error

807603Feb 11 2006 — edited Dec 19 2007
hi! i'm doing a small app for mobile devices, with j2me, netbeans5.0+mobility pack.
the problem is
String url = "http://www.google.ro/";
try {
      HttpConnection httpConnection =
            (HttpConnection) Connector.open(url, Connector.READ);
      if (httpConnection.getResponseCode() == HttpConnection.HTTP_OK) {
            // i do something around here
       }
        // doing some more of something
} catch (Exception e) {
          e.printStackTrace();
}
javax.microedition.io.ConnectionNotFoundException: TCP open

this is what i get when the program reaches httpConnection.getResponseCode() . i read that it's because a connection could not be established, or somethink like this, maybe because of a firewall or something else.

well, it so happens i connect to the internet through a proxy. but i tried starting the app with parameters like:
-Dhttp.proxyHost=192.168.xxx.xxx -Dhttp.proxyPort=8080

yet it still doesn't work. i get the same error.
what am i doing wrong? please help.

thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2008
Added on Feb 11 2006
3 comments
159 views