Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 11th, 2006, 9:22 AM   #1
xdev
Newbie
 
Join Date: Feb 2006
Posts: 3
Rep Power: 0 xdev is on a distinguished road
J2ME network error

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
xdev is offline   Reply With Quote
Old Feb 11th, 2006, 12:04 PM   #2
xdev
Newbie
 
Join Date: Feb 2006
Posts: 3
Rep Power: 0 xdev is on a distinguished road
i hope you understand.... what i mean is: i'm sure this code will work properly on a real cellphone, but i need to test it first, on a emulator

unfortunately my computer does not access the internet directly, but through a proxy. how can i test it so that i don't get that annoying error?
thanks again
xdev is offline   Reply With Quote
Old Feb 12th, 2006, 5:32 AM   #3
xdev
Newbie
 
Join Date: Feb 2006
Posts: 3
Rep Power: 0 xdev is on a distinguished road
Help Me Please
xdev is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:05 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC