Archived

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

Problem with gettting a proxy to ServiceManager

Hi there,

Howdy. I'm trying to get a proxy to ServiceManager in the same lines as in IceBox.Admin w/o extending Ice.Application.
ObjectPrx base = communicator.stringToProxy(managerProxy);
ServiceManagerPrx manager = ServiceManagerPrxHelper.checkedCast(base);

The control never returns from ServiceManagerPrxHelper.checkedCast(base);

I tried to trace the program but I'm lost. I'm missing something here.

Any ideas are greatly appreciated.

Thanks,
Venkatesh

Comments

  • mes
    mes California
    Hi,

    In order to help you we need more information. Whenever you post a request for help, please always specify the following information:
    • Ice version
    • Language mapping(s) in use
    • Platform and compiler information
    In this case it would also be helpful to know the context in which the code you've shown is being executed. For example, is this code from an IceBox service, or is this in a program that is trying to access the ServiceManager remotely?

    The most likely reason for a remote invocation to hang is if the server has run out of threads, i.e., all of the threads in its thread pool are busy. Increasing the size of the server's thread pool can alleviate this problem.

    Take care,
    - Mark
  • Hi Mark,

    Thanks for your reply. Please find the requested information below.

    * Ice version: 2.1.0
    * Language mapping(s) in use: Java
    * Platform and compiler information: Win2K, J2SE 1.5

    Execution Context: From a simple Java class that is trying to access the ServiceManager remotely.

    I tried increasing the Server and Client Thredpool size to 3 but the problem persists.

    Thanks,
    Venkatesh
  • mes
    mes California
    Hi,

    Is IceBox.Admin able to succesfully shut down the server? If so, then that would indicate the problem resides in your client. If not, then it is most likely a server issue.

    Are you using the default IceBox server implementation provided by Ice? Or are you using a custom implementation?

    If you are still having trouble, the best way to get this resolved quickly is to provide a small but complete example that we can use to reproduce the problem.

    Take care,
    - Mark
  • Thanks again Mark.

    Q. Is IceBox.Admin able to succesfully shut down the server?
    A. NOPE. Tried both IceBox.Admin and iceboxadmin, Wont work.

    Q. Are you using the default IceBox server implementation provided by Ice?
    A. Default IceBox.Server provided by Ice.

    Q. If you are still having trouble, the best way to get this resolved quickly is to provide a small but complete example that we can use to reproduce the problem.
    A. I'll try to get a sample but the app is wired with Spring. Lemme see what I can write up.

    Thanks,
    Venkatesh
  • mes
    mes California
    Another reason that a remote invocation (such as checkedCast) might hang is if the server's object adapter is not yet activated. However, if you are certain that your client is using the correct proxy for the ServiceManager, I doubt that this is the reason because the IceBox implementation clearly activates its object adapter.

    Is it possible that your client is connecting to another object adapter instead? If you are at all uncertain, I recommend running both the client and the IceBox server with --Ice.Trace.Network=3 and examining the output for verification.

    - Mark
  • <Mark>Another reason that a remote invocation (such as checkedCast) might hang is if the server's object adapter is not yet activated. However, if you are certain that your client is using the correct proxy for the ServiceManager, I doubt that this is the reason because the IceBox implementation clearly activates its object adapter.
    <SV> I might have run into this situation but not sure. Why dont I get an exception when servers adapter isnt yet activated.
    I do a lazy init of gettting the Proxy and things seem to work now.

    I do have the Network trace on. --Ice.Trace.Network=3

    Thanks for your helpful hints Mark,
    Venkatesh
  • mes
    mes California
    <SV> I might have run into this situation but not sure. Why dont I get an exception when servers adapter isnt yet activated.
    Although the object adapter is not activated, it has still created a socket for each endpoint and the operating system queues incoming connections. The object adapter does not actively accept new connections until it is activated, but to the client it appears it has connected successfully.
    I do a lazy init of gettting the Proxy and things seem to work now.
    I'm not sure what you mean. Can you provide more detail?

    - Mark
  • This makes sense to me now. I was initializing an object immediately after the startup of services which tries to get a proxy to the ServiceManager.
    I'm not sure what you mean. Can you provide more detail?
    Now, I delay the process of getting a handle to the ServiceManager proxy when I need to invoke methods on the SM. Hope, I'm clear this time.

    Thanks for the clarification.
    Venkatesh