Archived

This forum has been archived. Please start a new discussion on GitHub.

IceStorm Error on Android device : Ice.SocketException

Hi Everyone.

I'm currently trying to create for my master degree a streaming service with IceStorm. My problem come from that when i run it in local it's ok. But when i tried to access the adapter using my device ( same wifi hotspot) it's not working ...
Ice.ObjectPrx obj = ic.stringToProxy("MyServ/TopicManager:tcp -h 192.168.0.11 -p 10000");
                IceStorm.TopicManagerPrx topicManager = IceStorm.TopicManagerPrxHelper.checkedCast(obj);

                Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints("MonitorAdapter", "tcp -h 192.168.0.11 -p 10000");
                IceStorm.TopicPrx topic = null;
                Ice.ObjectPrx proxy = adapter.addWithUUID(monitor).ice_oneway();
                adapter.activate();

And i get :
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err﹕ Ice.SocketException
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err﹕ error = 0
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err﹕ at IceInternal.Network.doBind(Network.java:267)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.UdpTransceiver.<init>(UdpTransceiver.java:407)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.UdpEndpointI.transceiver(UdpEndpointI.java:443)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.IncomingConnectionFactory.<init>(IncomingConnectionFactory.java:362)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at Ice.ObjectAdapterI.<init>(ObjectAdapterI.java:1028)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.ObjectAdapterFactory.createObjectAdapter(ObjectAdapterFactory.java:160)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at Ice.CommunicatorI.createObjectAdapterWithEndpoints(CommunicatorI.java:89)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at ceri.client.app.Client.<init>(Client.java:55)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at com.example.momo.bigstreamer.MainActivity.<init>(MainActivity.java:26)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.Class.newInstanceImpl(Native Method)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.Class.newInstance(Class.java:1208)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2222)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.access$900(ActivityThread.java:161)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.os.Handler.dispatchMessage(Handler.java:102)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.os.Looper.loop(Looper.java:157)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.main(ActivityThread.java:5356)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.reflect.Method.invokeNative(Native Method)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.reflect.Method.invoke(Method.java:515)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at dalvik.system.NativeStart.main(Native Method)
04-08 21:01:45.701  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; Caused by: java.net.BindException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at libcore.io.IoBridge.bind(IoBridge.java:89)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:68)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at java.net.DatagramSocket.bind(DatagramSocket.java:457)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at java.nio.DatagramChannelImpl$DatagramSocketAdapter.bind(DatagramChannelImpl.java:536)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.Network.doBind(Network.java:261)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; ... 23 more
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; Caused by: libcore.io.ErrnoException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at libcore.io.Posix.bind(Native Method)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at libcore.io.ForwardingOs.bind(ForwardingOs.java:40)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at libcore.io.IoBridge.bind(IoBridge.java:87)
04-08 21:01:45.711  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; ... 27 more
04-08 21:01:45.721  23446-23446/com.example.momo.bigstreamer W/ApplicationPackageManager&#65109; getCSCPackageItemText()

I tried to just specify "tcp" on the createObjectAdapterWithEndPoints functions but i get another exception ... Ice.SocketException but with :
Caused by: java.net.SocketException: Can't bind to a link-local address without a scope id: /::

If you have an idea, it would be very helpful !

Thanks !
Sorry for my english grammar, i'm french ;)

Comments

  • benoit
    benoit Rennes, France
    Hi,

    The first exception shows that your application tries to create a UDP endpoint not a TCP endpoint. Can you check the code at the following lines to see where this UDP endpoint is coming from?
    04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at ceri.client.app.Client.<init>(Client.java:55)
    04-08 21:01:45.691  23446-23446/com.example.momo.bigstreamer W/System.err&#65109; at com.example.momo.bigstreamer.MainActivity.<init>(MainActivity.java:26)
    

    Could you post the full stack trace for the second exception? It sounds like your Android device has IPv6 enabled and tries to bind to a link local IPv6 address without specifying the scope IP of the interface. It's not totally clear to me under which circumstances this can occur however, possibly if the only IPv6 interface available on the device is a link local address.

    Cheers,
    Benoit.
  • Hi a thanks for helping me !

    Lines 55 on client is :
    Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints("MonitorAdapter", "tcp -h 192.168.0.11 -p 10000");
    
    And in the main activity it's where i instanciate the Client .
    For the second error i think it's normal because i don't specify the host adress on the AdapterWithEndpoints :
    Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints("MonitorAdapter", "tcp");
    

    An i got this stack strace :
    04-09 11:52:10.383  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; Ice.SocketException
    04-09 11:52:10.383  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; error = 0
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.Network.doBind(Network.java:251)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.TcpAcceptor.<init>(TcpAcceptor.java:119)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.TcpEndpointI.acceptor(TcpEndpointI.java:414)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.IncomingConnectionFactory.<init>(IncomingConnectionFactory.java:376)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at Ice.ObjectAdapterI.<init>(ObjectAdapterI.java:1028)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.ObjectAdapterFactory.createObjectAdapter(ObjectAdapterFactory.java:160)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at Ice.CommunicatorI.createObjectAdapterWithEndpoints(CommunicatorI.java:89)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at ceri.client.app.Client.<init>(Client.java:55)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at com.example.momo.bigstreamer.MainActivity.<init>(MainActivity.java:26)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.Class.newInstanceImpl(Native Method)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.Class.newInstance(Class.java:1208)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2222)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.access$900(ActivityThread.java:161)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.os.Handler.dispatchMessage(Handler.java:102)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.os.Looper.loop(Looper.java:157)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at android.app.ActivityThread.main(ActivityThread.java:5356)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.reflect.Method.invokeNative(Native Method)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at java.lang.reflect.Method.invoke(Method.java:515)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at dalvik.system.NativeStart.main(Native Method)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; Caused by: java.net.SocketException: Can't bind to a link-local address without a scope id: /::
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at libcore.io.IoBridge.bind(IoBridge.java:78)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:150)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at java.net.ServerSocket.bind(ServerSocket.java:319)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at java.nio.ServerSocketChannelImpl$ServerSocketAdapter.bind(ServerSocketChannelImpl.java:124)
    04-09 11:52:10.393  20514-20514/com.example.momo.bigstreamer W/System.err&#65109; at IceInternal.Network.doBind(Network.java:245)
    

    Thanks again !
  • Hi !
    It's just to let you know that i solved the problem ... I was getting the Icebox Adress despite of my android device adress ......

    Thanks for helping me your lib is awesome !