Home Help Center

Glacier2 and Servant Locators

andyxandyx Member Andrew PoloOrganization: InsystemProject: Distributed measurement/alarm system
My client application previousely worked directly with server application. It could obtain proxies to interfaces published via server's servant locators. But when I started to use Glacier2-based connections I always have ObjectNotExists exceptions. Server's code wasn't modifyed. Do I have this problem because it's impossible to obtain "dynamic" proxies via Glacier2 router?

Thanks

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    An ObjectNotExistException from Glacier2 often indicates that Glacier2 rejected the request. You must first establish a session with Glacier2 and maintain this session alive to be able to forward requests to your server. You can enable tracing on the Glacier2 router to confirm it's indeed rejecting the requests, set Glacier2.Client.Trace.Reject=1 and Glacier2.Client.Trace.Request=1 in the Glacier2 configuration file. For more information on how to use Glacier2 I recommend checking out the demos and the manual.

    Cheers,
    Benoit.
  • andyxandyx Member Andrew PoloOrganization: InsystemProject: Distributed measurement/alarm system
    I do. I use sessions. Everythigs worked fine until I decided to get proxy published on the server using Servant Locator. Without router I used this code for obtaining proxy in client application:
    Ice.Identity id = new Ice.Identity() { name="file.ext", category="search" };
    
    // m_proxy is a proxy to a "regular" interface (published with EndPoint) successfully obtained 
    // via Default Router i.e. Glacier2 from the server
    
    var file = project.fileSerchPrxHelper(m_proxy.ice_getConnection().createProxy(id));
    
    
    From Glacier2 log I see that it fails on "ice_add_proxy" operation. Does Router have to perform this action itself or it just has to pass it to the server of associated connection to allocate requested proxy?

    P.S. Again, my application works well via router except for obtaining "dynamic" proxies using the last line of my sample code (above). I usualy read mans and search Internet befor asking "stupid" questions.
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Andrew,

    Ice has direct proxies, indirect proxies and fixed proxies, but not dynamic proxies.

    A proxy created by createProxy on a connection is called a "fixed proxy". See Bidirectional Connections - Ice 3.4 - ZeroC for full details.

    Fixed proxies give access to objects "on the other side" of a connection. When you use Glacier2, the "other side" of the connection is the Glacier2 router, not your server or client. As a result, you can't use fixed proxies with Glacier2.
    Everythigs worked fine until I decided to get proxy published on the server using Servant Locator.

    I don't see how Servant Locators are involved here. A Servant Locator is purely local to a server - it helps an object adapter locates servants - and is not used to create or publish proxies.

    Best regards,
    Bernard
  • andyxandyx Member Andrew PoloOrganization: InsystemProject: Distributed measurement/alarm system
    Sorry, guys. With my poor English I couldn't explain you my problem. You point me to the incorrect terms I'm using. You're right. It's easier to blame me for the incorrect question then answer it. Anyway, I found solution. In case if I want to use servant (skeleton, interface implementation - whatever it could be named), I just add method to one of interfaces obtainable via Default Locator. In this case inside such an operation I use the same "instantiating by Identity with the category" method as I previosely did on client side, and return obtained proxy to a client as a result of the operation.
Sign In or Register to comment.