Ask Your Question
0

Error registering rosandroid client

asked 2013-02-28 02:09:00 -0500

Rocha gravatar image

updated 2014-01-28 17:15:26 -0500

ngrennan gravatar image

Hello everyone, i'm trying to create a rosjava client to connect to a c++ service, but when the client is being registered the following warning is showed.

02-28 10:28:06.275: W/DefaultChannelPipeline(335): An exception was thrown by a user handler while handling an exception event ([id: 0x406087c0] EXCEPTION: java.nio.channels.UnresolvedAddressException) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335): org.ros.exception.RosRuntimeException: java.nio.channels.UnresolvedAddressException 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.transport.ConnectionTrackingHandler.exceptionCaught(ConnectionTrackingHandler.java:81) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:533) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:157) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:102) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:55) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.channel.Channels.connect(Channels.java:642) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:205) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:230) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:183) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.transport.tcp.TcpClient.connect(TcpClient.java:105) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.transport.tcp.TcpClientManager.connect(TcpClientManager.java:71) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.node.service.DefaultServiceClient.connect(DefaultServiceClient.java:137) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.node.service.ServiceFactory.newClient(ServiceFactory.java:148) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.node.DefaultNode.newServiceClient(DefaultNode.java:365) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.node.DefaultNode.newServiceClient(DefaultNode.java:372) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.android.android_tutorial_pubsub.EnviaDadosClient.onStart(EnviaDadosClient.java:32) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.node.DefaultNode$5.run(DefaultNode.java:506) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.internal.node.DefaultNode$5.run(DefaultNode.java:503) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.concurrent.EventDispatcher.loop(EventDispatcher.java:43) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at org.ros.concurrent.CancellableLoop.run(CancellableLoop.java:56) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) 
02-28 10:28:06.275: W/DefaultChannelPipeline(335):  at java.lang.Thread.run(Thread.java:1019) 
02-28 10:28:06.275: W/DefaultChannelPipeline ...
(more)
edit retag flag offensive close merge delete

Comments

Please provide some more context. Code and especially network settings. See your error "Caused by: java.nio.channels.UnresolvedAddressException"

damonkohler gravatar image damonkohler  ( 2013-03-02 02:46:46 -0500 )edit
1

Same problem :(

paulofinseca gravatar image paulofinseca  ( 2013-03-02 13:04:14 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2013-03-03 14:37:59 -0500

Rocha gravatar image

I already solved the problem... it was problem of configuration of hosts on emulator

To solve the problem follow these steps...

With the emulator arleady opened, run:

cd adt-bundle/sdk/platform-tools/

./adb -s  emulator-5554 remount

To remount the filesystem so its not read only and you’ll be able to change the hosts file.

Then run:

./adb -s  emulator-5554 pull /etc/hosts

This gets the current hosts file from the device. Edit it in whatever text editor, it’s been pulled to the current working dir. I used gedit. gedit hosts

and add the following line

10.0.2.2   machineName

in my case

10.0.2.2   rocha

Finally run:

./adb -s  emulator-5554 push hosts /etc/hosts
edit flag offensive delete link more

Comments

Not worked for me :( Can you run without problems on your smartphone?

paulofinseca gravatar image paulofinseca  ( 2013-03-05 13:46:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-02-28 02:09:00 -0500

Seen: 198 times

Last updated: Mar 03 '13