×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    1

    java.io.IOException: SymbianOS error = -28 : System error

    I am getting the following stack trace when trying to use post a HTTP request to the Tomcat 4.1. I am using the "Series 60 MIDP SDK 2.1 Emulator" for executing my MIDLets for posting the HTTP request.

    Could any one of you please help me in solving this issue.


    Code:
    	HttpConnection c = null;
    	OutputStream os = null;
    
            try 
    	{
                c = (HttpConnection)Connector.open(url);
    
                // Set the request method and headers
                c.setRequestMethod(HttpConnection.POST);
                c.setRequestProperty("If-Modified-Since",
                    "29 Oct 1999 19:43:31 GMT");
                c.setRequestProperty("User-Agent",
                    "Profile/MIDP-2.0 Configuration/CLDC-1.0");
                c.setRequestProperty("Content-Language", "en-US");
    
                // Getting the output stream may flush the headers
                os = c.openOutputStream();
    
                os.write("LIST games\n".getBytes());
    
    	    os.flush();           
    
    	    // The line which causes the error	
    	    int rc = c.getResponseCode();
    	}
    	catch(Exception expException)
    	{
    		expException.printStackTrace()
    	}
    
    //End of the code
    
    //Stack Trace of the error
    
    java.io.IOException: SymbianOS error = -28 : System error.
            at com.symbian.gcf.ConnectionEndPoint.open(+126)
            at com.symbian.midp.io.protocol.http.HttpConnectionImpl.connect(+23)
            at com.symbian.midp.io.protocol.http.HttpConnectionImplBase.connect(+8)
            at com.symbian.midp.io.protocol.http.HttpConnectionImplBase.ensureConnected(+28)
            at com.symbian.midp.io.protocol.http.HttpConnectionImplBase.ensureResponse(+4)
            at com.symbian.midp.io.protocol.http.HttpConnectionImplBase.getResponseCode(+8)
            at thread.writeToURL(+117)
            at thread.run(+8)

  2. #2
    Registered User
    Join Date
    Aug 2004
    Posts
    20

    me too

    i've got that error too
    my code is

    try{ SocketConnection sc = (SocketConnection)
    Connector.open("socket://localhost:79");
    sc.setSocketOption(SocketConnection.LINGER, 5);

    InputStream is = sc.openInputStream();
    OutputStream os = sc.openOutputStream();

    //os.write("hello".getBytes());
    byte b[] = new byte[1024];
    int jj=0;
    while(jj != -1) {
    jj = is.read(b);
    }
    append(new String(b));
    is.close();
    os.close();
    sc.close();
    }catch(Exception e){e.printStackTrace();}

    and my runtime eooro is
    java.io.IOException: SymbianOS error = -28 : System error.
    at com.symbian.gcf.ConnectionEndPoint.open(+126)
    at com.symbian.midp.io.protocol.socket.Protocol.openConnection(+92)
    at com.symbian.gcf.ProtocolBase.openConnection(+145)
    at com.symbian.gcf.GCFConnector.open(+197)
    at javax.microedition.io.Connector.open(+7)
    at javax.microedition.io.Connector.open(+6)
    at javax.microedition.io.Connector.open(+5)
    at MainPage.sendToServer(+5)
    at MainPage.commandAction(+27)
    at javax.microedition.lcdui.Displayable.commandAction(+75)
    at javax.microedition.lcdui.Displayable.processEvent(+42)
    at javax.microedition.lcdui.Toolkit.handleEventCallback(+68)
    at com.symbian.lcdjava.lang.SystemExtensions.dispatchCallbacks(+6)
    at com.symbian.midp.runtime.KVMEventProcessor.run(+7)
    help me please

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    5
    Hello,

    try to create connection (only openConnection method) in separate thread...

    class MIDlet extentds MIDlet implements Runnable {

    // player is instance of Player

    public void run() {
    player.openConnection();
    player.state = Player.STATE_READY;
    }

    }

    class Player {
    final static int STATE_INITIAL = 0;
    final static int STATE_CONNECTING = 1;
    final static int STATE_READY = 2;
    final static int STATE_...

    public void run() {
    switch (state) {

    case STATE_INITIAL:
    state = STATE_CONNECTING;
    X.playerCanvas.repaint();
    //openConnection();
    Thread connecting = new Thread(X.singleton);
    connecting.start();
    //Display.getDisplay(X.singleton).callSerially(this);
    break;

    case STATE_READY:
    // ok
    break;

    ....
    }
    }


    Jozef Prídavok, (pridavok.sk)
    Last edited by oxy77; 2007-06-14 at 12:35.

Posting Permissions

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