×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    4

    Java ME S40 java.io.IOException: No Response Entries Available

    I have nokia app that works fine until it gets to the end, where it has to send small final message over http.. When it gets to the point os.flush(), it throws following exception:

    Code:
        java.io.IOException: No Response Entries Available
        at com.nokia.mid.impl.isa.io.protocol.internal.wap.Protocol.openPrim(+75)
        at com.sun.midp.io.InternalConnector.openPrim(+157)
        at com.sun.midp.io.InternalConnector.openInternal(+9)
        at com.sun.midp.io.j2me.http.Protocol.connect_wap(+210)
        at com.sun.midp.io.j2me.http.Protocol.connect(+107)
        at com.sun.midp.io.j2me.http.Protocol$PrivateOutputStream.flush(+39)
        at java.io.DataOutputStream.flush(+7)
        at MyApp.HttpCom.writeOutputStream(+242)
        at MyApp.HttpRemAuth.remAuth(+179)
        at MyApp.HttpRemAuth.run(+24)
    It sends all other messages before this last one.. it works with no issues on S60 nokia phones... But on S40 it fails ...

    Code:
    boolean writeOutputStream(HttpConnection con, OutputStream os)
    	{
                  try{
    		os = con.openOutputStream();
    		os.write(m.toString().getBytes("UTF-8")); 
    		m.delete(0, m.length());
    		Runtime.getRuntime().gc();
    		Thread.yield();
    		
    		int index = 0;
    		int size = 1024;
    		do{		
    			if((index+size)>fileBytes.length)
    			{
    				size = fileBytes.length - index; 
    			}	
    		    os.write(fileBytes, index, size);
    		    index+=size;
    		  }
    		while(index < fileBytes.length);	
    		os.write(getFooterMessage().getBytes());
    		
    		try{
    			os.flush();
    			
    		}catch (Exception e)
    		{
    			debug("Here comes Exception!");
    			e.printStackTrace();
    			return false;
    
    		}
    		
    			return true;
    		}catch (Exception e)
    		{
    			return false;
    		}	
    		finally {
    			
    			debug("Just sent data to the server..!");
    			closeOutputStream(os);		
    		}
    	}
    Please HELP!

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    678

    Re: Java ME S40 java.io.IOException: No Response Entries Available

    A couple of things...

    are you saying your doing this when the app is about to exit? if so you should know that u have very little time before the jvm will kill the process
    and if not the http itself has timeouts so i would advice against stuff like
    "Runtime.getRuntime().gc();
    Thread.yield();"
    which i have no idea why your doing that...

    Also since its an http connection why are you calling os.flush and not con.getResponseCode() which will implicitly flush out your data as well as doing other http related stuff.

  3. #3
    Registered User
    Join Date
    Aug 2013
    Posts
    4

    Re: Java ME S40 java.io.IOException: No Response Entries Available

    Thanks.
    I've tried a bunch of things like con.getResponse() , removed Run.Runtime.blah and similar but nothing changed. As for exiting app, Exit is triggered only when (if) http message gets away successfully..

  4. #4
    Registered User
    Join Date
    Aug 2013
    Posts
    4

    Re: Java ME S40 java.io.IOException: No Response Entries Available

    Got it fixed.... It wasn't closing connection con..

Similar Threads

  1. Replies: 4
    Last Post: 2013-02-03, 08:11
  2. IOException java.io.IOException: 40-Error in HTTP operation
    By @RainierLabs in forum Mobile Java General
    Replies: 2
    Last Post: 2011-05-06, 14:23
  3. java.io.IOException: Out of response entries in 6300
    By mtuhukumar k in forum Mobile Java Networking & Messaging & Security
    Replies: 16
    Last Post: 2009-10-12, 10:56
  4. java.io.IOException: -36
    By Sratytaty in forum Mobile Java General
    Replies: 0
    Last Post: 2009-07-31, 09:47
  5. Replies: 16
    Last Post: 2005-08-01, 11:02

Posting Permissions

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