Results 1 to 5 of 5

Thread: Ice/Android Ice.ConnectionRefusedException error=0

  1. #1
    gtan is offline Registered User
    Name: Gaurav Taneja
    Organization: Ishi Systems
    Project: Learning
    Join Date
    Jul 2009
    Posts
    3

    Ice/Android Ice.ConnectionRefusedException error=0

    Hi,

    I am facing a network issue with a simple ice-android app.
    Here's the stacktrace:

    07-01 16:17:25.720: WARN/System.err(733): [ 7/1/09 16:17:25:724 Network: trying to establish tcp connection to 127.0.0.1:10001 ]
    07-01 16:17:25.790: WARN/System.err(733): [ 7/1/09 16:17:25:793 Network: failed to establish tcp connection
    07-01 16:17:25.790: WARN/System.err(733): local address = 127.0.0.1:0
    07-01 16:17:25.790: WARN/System.err(733): remote address = <not connected>
    07-01 16:17:25.800: WARN/System.err(733): Ice.ConnectionRefusedException
    07-01 16:17:25.800: WARN/System.err(733): error = 0 ]
    07-01 16:17:25.810: WARN/System.err(733): [ 7/1/09 16:17:25:810 Network: shutting down tcp connection for reading and writing
    07-01 16:17:25.810: WARN/System.err(733): local address = 127.0.0.1:0
    07-01 16:17:25.810: WARN/System.err(733): remote address = <not connected> ]
    07-01 16:17:26.050: DEBUG/dalvikvm(733): GC freed 4221 objects / 268240 bytes in 94ms
    07-01 16:17:26.110: WARN/System.err(733): [ 7/1/09 16:17:26:109 Network: trying to establish tcp connection to 127.0.0.1:10001 ]
    07-01 16:17:26.119: WARN/System.err(733): [ 7/1/09 16:17:26:121 Network: closing tcp connection
    07-01 16:17:26.119: WARN/System.err(733): local address = 127.0.0.1:0
    07-01 16:17:26.119: WARN/System.err(733): remote address = <not connected> ]
    07-01 16:17:26.149: WARN/System.err(733): [ 7/1/09 16:17:26:151 Network: failed to establish tcp connection
    07-01 16:17:26.169: WARN/System.err(733): local address = 127.0.0.1:0
    07-01 16:17:26.169: WARN/System.err(733): remote address = <not connected>
    07-01 16:17:26.169: WARN/System.err(733): Ice.ConnectionRefusedException
    07-01 16:17:26.169: WARN/System.err(733): error = 0 ]
    07-01 16:17:26.180: WARN/System.err(733): [ 7/1/09 16:17:26:179 Network: shutting down tcp connection for reading and writing
    07-01 16:17:26.189: WARN/System.err(733): local address = 127.0.0.1:0
    07-01 16:17:26.189: WARN/System.err(733): remote address = <not connected> ]
    07-01 16:17:26.219: WARN/System.err(733): [ 7/1/09 16:17:26:224 Network: closing tcp connection
    07-01 16:17:26.229: WARN/System.err(733): local address = 127.0.0.1:0
    07-01 16:17:26.239: WARN/System.err(733): remote address = <not connected> ]
    07-01 16:17:26.250: VERBOSE/ice(733): Ice.ConnectionRefusedException
    07-01 16:17:26.250: VERBOSE/ice(733): error = 0
    07-01 16:17:26.250: VERBOSE/ice(733): at IceInternal.Network.doConnect(Network.java:343)
    07-01 16:17:26.250: VERBOSE/ice(733): at IceInternal.TcpTransceiver$1.run(TcpTransceiver.ja va:35)
    07-01 16:17:26.250: VERBOSE/ice(733): at java.lang.Thread.run(Thread.java:1058)
    07-01 16:17:26.250: VERBOSE/ice(733): Caused by: java.net.ConnectException: Connection refused
    07-01 16:17:26.250: VERBOSE/ice(733): at org.apache.harmony.luni.platform.OSNetworkSystem.c onnectSocketImpl(Native Method)
    07-01 16:17:26.250: VERBOSE/ice(733): at org.apache.harmony.luni.platform.OSNetworkSystem.c onnect(OSNetworkSystem.java:125)
    07-01 16:17:26.250: VERBOSE/ice(733): at org.apache.harmony.nio.internal.SocketChannelImpl. connect(SocketChannelImpl.java:283)
    07-01 16:17:26.250: VERBOSE/ice(733): at IceInternal.Network.doConnect(Network.java:331)
    07-01 16:17:26.250: VERBOSE/ice(733): ... 2 more



    Here're the other details

    Communicator properties:
    Ice.Trace.Network=2

    Android 1.5/1.1
    IceAndroid - 0.1.1
    OS= Vista

    Proxy String: testservice:tcp -h localhost -p 10001
    Manifest:
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    I can access the service through a servlet client (and also telnet).
    So, the issue seems to be with the AndroidIce runtime.

    I read a similar thread where the issue was traced to AndroidIce 0.1.0 and was resolved by patching three files, incl. IceInternal.TcpTransceiver mentioned in the stacktrace.
    Since I am using 0.1.1, I presume that the issue lies elsewhere.

    Any suggestions?

    Thanks,
    Gaurav.
    Last edited by gtan; 07-01-2009 at 01:44 PM. Reason: incomplete title

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    Hi,

    Welcome to the forum.

    The issue I described in this post also applies to version 0.1.1, but I don't think that's the problem in this case.

    It appears that your Android app is attempting to connect to an Ice server running on the device (or emulator). Is that correct? If so, is this server a separate application, or are the client and server components in the same app?

    Regards,
    Mark

  3. #3
    gtan is offline Registered User
    Name: Gaurav Taneja
    Organization: Ishi Systems
    Project: Learning
    Join Date
    Jul 2009
    Posts
    3
    Hi Mark,

    The Ice server is a separate component (a jar file) - which works fine with other clients.
    The issues comes into picture when I try to access it from the Android emulator.

    Also, I was earlier referring to this post

    Thanks,
    Gaurav.
    Last edited by gtan; 07-01-2009 at 02:17 PM. Reason: more information

  4. #4
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    Hi,

    It's still not clear to me whether your Ice server is running on your host (the development machine) or in your emulator. Can you clarify that?

    If the server is running on your host, then you are using the wrong IP address. The emulator uses a virtual router, and the address of the host is 10.0.2.2. If you want an Android app running in the emulator to connect to a server running on the host, you need to use 10.0.2.2 and not the localhost address.

    Regards,
    Mark

  5. #5
    gtan is offline Registered User
    Name: Gaurav Taneja
    Organization: Ishi Systems
    Project: Learning
    Join Date
    Jul 2009
    Posts
    3
    I am running the the Ice Server on the development machine.
    But, the real issue, as you pointed out was the incorrect IP. I corrected it back to 10.0.2.2 to resolve it.

    Thanks for the help,
    Gaurav.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Ice for Android 0.2.0 released
    By mes in forum Announcements
    Replies: 0
    Last Post: 02-08-2011, 04:32 PM
  2. Replies: 4
    Last Post: 12-14-2010, 05:15 PM
  3. ICE Android connection issue
    By MaddawgX9 in forum Help Center
    Replies: 36
    Last Post: 03-28-2009, 11:46 PM
  4. IceGrid: Ice.ConnectionRefusedException
    By mefoster in forum Help Center
    Replies: 13
    Last Post: 09-25-2006, 05:31 AM
  5. About Ice::ConnectionRefusedException
    By level in forum Help Center
    Replies: 6
    Last Post: 01-09-2006, 08:25 PM

Posting Permissions

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