Hello,
I try to do the following:
1) implement a simple HTTP request
2) get a response code from the webserber
In step 2 my program throws a "javax.microedition.io.ConnectionNotFoundException: TCP open" in the "com.sun.midp.io.j2me.socket.Protocol.connect" method.
This happens only when I use my code in a polish project (with the polish build.xml). In a standard J2ME project everything works fine. So it isn't a problem with proxies or firewalls. I am using the IDE Netbeans 6.5.1
Request code is as follows:
RegardsCode:public void openHttpsConnection() { String base = "https://webdav.mediencenter.t-online.de"; String url = base; String msg = null; int code = -1; DataInputStream result = null; try { HttpsConnection conn = (HttpsConnection)Connector.open(url); if( conn == null ) { System.out.println("Conection is NULL!!!"); } else { conn.setRequestMethod(HttpConnection.GET); msg = conn.getResponseMessage(); // ERROR HERE code = conn.getResponseCode(); result = new DataInputStream(conn.openInputStream()); result.close(); conn.close(); } } catch (IOException ex) { ex.printStackTrace(); } }
Stefan

Reply With Quote

