×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4

    HttpsConnection doesn't work with polish

    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:

    Code:
    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();
            }
        }
    Regards
    Stefan

  2. #2
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: HttpsConnection doesn't work with polish

    have you also tried to ask in the Polish forum itself ?
    It might be some bug or so... as far as I can deduce from your post the problem isn't actually within the J2ME code/functionality..

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4

    Re: HttpsConnection doesn't work with polish

    yes I asked in that forum but got no answer yet.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: HttpsConnection doesn't work with polish

    Is it possible that the emulator is running in some different configuration in your Polish project? I can't think of anything that Polish could actually do to make this happen. Try building a JAD/JAR, and running the emulator from the command line, to eliminate any configuration that's happening though the IDE.

    Graham.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4

    Re: HttpsConnection doesn't work with polish

    Yes its definitely sth with the polish build.xml script. I dont know how to set the correct proxy parameters there. The Netbeans and WTK - specific proxy settings doesnt seem to work if the polish build script is executed =(

  6. #6
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: HttpsConnection doesn't work with polish

    hhmm... afaik you dont have to set any proxy settings in the build.xml file...
    that wouldnt be very clever indeed, cause that would mean you should make a build for every single Access Point that uses (or doesnt use) proxy's...

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4

    Re: HttpsConnection doesn't work with polish

    but somewhere (I think in the build.xml) I need to define the proxy settings that the sun wtk 2.5.2 emulator should use. there is an emulator section in that build script but I dont find any information how to set the proxy settings there and the proxy settings from netbeans doesnt work anymore when I use the polish build script...

Similar Threads

  1. Which FP1/FP" devices does Music Player Remote Control API not work on
    By kevinvernon in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2009-02-09, 12:17
  2. Replies: 1
    Last Post: 2008-11-20, 08:45
  3. J2ME Polish + Netnbeans 6.1 + Vista Combo... even possible ???
    By Tiger79 in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2008-07-21, 15:07
  4. J2ME Polish: a new build tool for professionals
    By enough in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-05-17, 18:02
  5. CommConnection does not work with Series 60 SDK, but works in JWT
    By jackiechan2001 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-02-04, 09:07

Posting Permissions

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