Issue using the Java client API from a remote host
|
|
---|---|
Hi, I have some issues trying to use the Java client API remotely. I'm using the Tango VM V9, and configured a static IP address for the VM (setting VirtualBox 'Bridged Adapter'). Running the attached code from my Host machine (so remotely), I get the output below. Running it locally (i.e. in the Tango VM), everything is fine ! Any hints ? Thanks, Jerome Host name/address cannot be determined ! org.omg.CORBA.COMM_FAILURE: vmcid: 0x0 minor code: 0 completed: Maybe at org.jacorb.orb.giop.ReplyPlaceholder.getInputStream(ReplyPlaceholder.java:127) at org.jacorb.orb.ReplyReceiver.getReply(ReplyReceiver.java:386) at org.jacorb.orb.Delegate._invoke_internal(Delegate.java:1479) at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1248) at org.jacorb.orb.Delegate.invoke(Delegate.java:1236) at org.jacorb.orb.dii.Request._invoke(Request.java:316) at org.jacorb.orb.dii.Request.access$000(Request.java:46) at org.jacorb.orb.dii.Request$Caller.run(Request.java:458) DeviceProxy(sim/motor/1).read_attributes_5_reply(StepSize) StepSize: 40.0 Waiting all async requests… attr_read() called! Position: 71.03 ====================== ZMQ (3.22) event system is available ============================ Host name/address cannot be determined ! Tango exception Severity -> ERROR Desc -> Host name/address cannot be determined ! Reason -> TangoApi_NetworkSystemException Origin -> HostInfo.HostInfo() fr.esrf.Tango.DevFailed: IDL:Tango/DevFailed:1.0 at fr.esrf.TangoDs.Except.throw_exception(Except.java:354) at fr.esrf.TangoDs.Except.throw_exception(Except.java:324) at fr.esrf.TangoApi.HostInfo.<init>(HostInfo.java:98) at fr.esrf.TangoApi.HostInfo.getAddress(HostInfo.java:154) at fr.esrf.TangoApi.ApiUtil.getHostAddress(ApiUtil.java:200) at fr.esrf.TangoApi.AccessProxy.checkAccessControl(AccessProxy.java:124) at fr.esrf.TangoApi.DatabaseDAODefaultImpl.checkAccessControl(DatabaseDAODefaultImpl.java:2310) at fr.esrf.TangoApi.Database.checkAccessControl(Database.java:1620) at fr.esrf.TangoApi.ConnectionDAODefaultImpl.initCtrlAccess(ConnectionDAODefaultImpl.java:484) at fr.esrf.TangoApi.ConnectionDAODefaultImpl.get_exported_ior(ConnectionDAODefaultImpl.java:517) at fr.esrf.TangoApi.ConnectionDAODefaultImpl.init(ConnectionDAODefaultImpl.java:164) at fr.esrf.TangoApi.Connection.<init>(Connection.java:198) at fr.esrf.TangoApi.DeviceProxy.<init>(DeviceProxy.java:144) at fr.esrf.TangoApi.DeviceProxyFactory.get(DeviceProxyFactory.java:112) at fr.esrf.TangoApi.DeviceProxyDAODefaultImpl.import_admin_device(DeviceProxyDAODefaultImpl.java:186) at fr.esrf.TangoApi.DeviceProxyDAODefaultImpl.get_adm_dev(DeviceProxyDAODefaultImpl.java:1649) at fr.esrf.TangoApi.DeviceProxy.get_adm_dev(DeviceProxy.java:881) at fr.esrf.TangoApi.events.EventConsumer.callEventSubscriptionAndConnect(EventConsumer.java:191) at fr.esrf.TangoApi.events.EventConsumer.subscribe_event(EventConsumer.java:270) at fr.esrf.TangoApi.events.EventConsumerUtil.subscribe_event(EventConsumerUtil.java:251) at fr.esrf.TangoApi.events.EventConsumerUtil.subscribe_event(EventConsumerUtil.java:188) at fr.esrf.TangoApi.DeviceProxyDAODefaultImpl.subscribe_event(DeviceProxyDAODefaultImpl.java:3407) at fr.esrf.TangoApi.DeviceProxy.subscribe_event(DeviceProxy.java:1718) at bonjourtangoasync.BonjourTangoAsync.getChangeEvents(BonjourTangoAsync.java:53) at bonjourtangoasync.BonjourTangoAsync.<init>(BonjourTangoAsync.java:28) at bonjourtangoasync.BonjourTangoAsync.main(BonjourTangoAsync.java:21) |
|
|
---|---|
Hi Jerome, I think the issue is because of the problem in the DNS resolution of the hostname (i.e tango9-vm) of your TANGO Virtual Machine from your host machine. Please verify this independently by performing following steps: 1. Open Command Prompt (for Windows) or terminal (for Linux) from your Host machine. 2. Fire "ping tango9-vm" command. 3. If everything is fine, reply will come from the TANGO Virtual Machine. I believe in your case the ping request will fail. If that is the case, then you can resolve the issue by manually adding an entry in the hosts file for your system. If the ping command fails even after adding an entry in the hosts file then you may have to change the type of network used for your virtual machine. Hope this helps in resolving the problem !!! Vatsal Trivedi |
|
|
---|---|
Hi Vatsal, Thanks for the quick response. The DNS resolution is ok, and the ping works fine. FYI, I also tried to use directly the IP address, same result. As you can see in the ouput, some API calls work as expected and return an attribute value: read_attribute_asynch() get_asynch_replies() The following call cause the exception: subscribe_event() Sorry, I should have been more explicit in my first message. Thanks, Jerome |
|
|
---|---|
Hi Jerome, Apologies for not noticing that only subscribe_event() call is causing the exception and other API calls such as read_attribute_asynch() and get_asynch_replies() are working fine. Could you please try by adding an entry in the hosts file of the host machine for the mapping between the hostname and IP address of the host machine (not the TANGO Virtual Mchine as I suggested in the previous post). I'm able to reproduce the exception when hostname of host machine is not getting resolved. Vatsal Trivedi |
|
|
---|---|
Hi Vatsal, Thank you for the help, I did what you suggested and I'm making progress Now I get an authorization issue (see below). It is not surprising to me: I didn't give any right to my (remote) host. What is more surprising is that it seems I need write access to be able to subscribe to change events… Reading the documentation, I see that the Astor tool should allow to give this write access. Trying to set this, I selected 'Access Control'>'ManagerPanel', and a password is asked. I tried the 'tango' password, without success. Where should I get the Access Control password on the Tango VM ? Am I going in the right direction ? Thanks again, Jerome ====================== ZMQ (3.22) event system is available ============================ dserver/SimMotor/test.ZmqEventSubscriptionChange -> TangoApi_READ_ONLY_MODE Tango exception Severity -> PANIC Desc -> dserver/SimMotor/test.command_inout(ZmqEventSubscriptionChange) is not authorized for: jerome on mymac Reason -> TangoApi_READ_ONLY_MODE Origin -> Connection.command_inout() fr.esrf.TangoApi.ConnectionFailed at fr.esrf.TangoDs.Except.throw_connection_failed(Except.java:616) at fr.esrf.TangoDs.Except.throw_connection_failed(Except.java:553) at fr.esrf.TangoApi.ConnectionDAODefaultImpl.throwNotAuthorizedException(ConnectionDAODefaultImpl.java:831) at fr.esrf.TangoApi.ConnectionDAODefaultImpl.command_inout(ConnectionDAODefaultImpl.java:882) at fr.esrf.TangoApi.Connection.command_inout(Connection.java:375) at fr.esrf.TangoApi.events.EventConsumer.callEventSubscriptionAndConnect(EventConsumer.java:193) at fr.esrf.TangoApi.events.EventConsumer.subscribe_event(EventConsumer.java:270) at fr.esrf.TangoApi.events.EventConsumerUtil.subscribe_event(EventConsumerUtil.java:251) at fr.esrf.TangoApi.events.EventConsumerUtil.subscribe_event(EventConsumerUtil.java:188) at fr.esrf.TangoApi.DeviceProxyDAODefaultImpl.subscribe_event(DeviceProxyDAODefaultImpl.java:3407) at fr.esrf.TangoApi.DeviceProxy.subscribe_event(DeviceProxy.java:1718) at bonjourtangoasync.BonjourTangoAsync.getChangeEvents(BonjourTangoAsync.java:53) at bonjourtangoasync.BonjourTangoAsync.<init>(BonjourTangoAsync.java:28) at bonjourtangoasync.BonjourTangoAsync.main(BonjourTangoAsync.java:21) |
|
|
---|---|
Hi Jerome, You are certainly on the right track. It is mentioned in this post on the forum that default password is "SUPER_TANGO". Alternatively you can start the Astor tool with the option "-DSUPER_TANGO=true". In case you have difficulty in setting appropriate access rights and want to bypass the TANGO Access Control then create an environment variable SUPER_TANGO in your host machine and set it to true. Bypassing the TANGO Access Control is a quick fix for getting the things going. Correct way would be to add appropriate access for your user as you pointed out. Vatsal Trivedi |
|
|
---|---|
Vatsal, I finally get it working For some reasons, trying to have 'All Users' the Write access for any Devices didn't work. Adding a specific user with a set of 'Allowed Adresses' was OK. Thanks for your help ! Jerome |
|
|
---|---|
Hi Jerome, Glad to know that the issue got resolved. The issue was that the user jerome was not authorised to invoke ZmqEventSubscriptionChange command on the admin device. ZmqEventSubscriptionChange is used by the DeviceProxy.subscribe_event() method and one of the event thread on the client side to inform the server to keep on generating events for the attribute. Vatsal Trivedi |
|
|
---|---|
Hi Jérome, i am trying to do the same thing by calling java program or by acceding to the MySQL database. could you please exlpain the steps to follow: how did you setup Virtual box networking (some samples please) and how to connect to database? thank you |