Archived

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

Glacier2 checkedCast loses connection...

I'm trying to use Glacier2 without the default router, in IceJ. I'm stuck and would welcome any hints.

Currently I'm testing a version of the demo program Callback. I've added the following two lines to the run function:

Ice.ObjectPrx proxy = communicator().stringToProxy("Glacer2/router:ssl -p 10005");/
Ice.RouterPrx routerPrxy = Ice.RouterPrxHelper.checkedCast(proxy);

When I run the Client I get a connection lost exception when it tries to run the checkedCast. The server and session server logs show no indication of connections. The Glacier2 trace shows:

[ glacier2router: Network: accepted ssl connection
local address = 3.4.5.6:10005
remote address = 3.4.5.6:34514 ]
[ glacier2router: Protocol: sending validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ glacier2router: Network: closing ssl connection
local address = 3.4.5.6:10005
remote address = 3.4.5.6:34514 ]


Thanks,
Brian

Comments

  • mes
    mes California
    Hi Brian,

    Please update your signature as described in our forum support policy.

    Thanks,
    - Mark
  • doh

    Yeah, I saw that policy about two minutes after I posted. It's now updated.

    Apologies,
    Brian
  • mes
    mes California
    Thanks Brian,

    Did you configure SSL properly in IceJ? Try setting IceSSL.Trace.Security=1 in the client and Glacier2 to see if any clues are provided.

    Take care,
    - Mark
  • Thanks for the quick reply.

    Ok, I switched everything back to tcp to make things simpler (I hope). I still get the connection lost, and now glacier gives me the following:

    [ glacier2router: Network: accepted tcp connection
    local address = 3.4.5.6:10005
    remote address = 3.4.5.6:33977 ]
    [ glacier2router: Protocol: sending validate connection
    message type = 3 (validate connection)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 14 ]
    [ glacier2router: Protocol: received request
    message type = 0 (request)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 58
    request id = 1
    identity = Glacier2/router
    facet =
    operation = getClientProxy
    mode = 1 (nonmutating)
    context = ]
    [ glacier2router: Protocol: sending reply
    message type = 2 (reply)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 51
    request id = 1
    reply status = 2 (object not exist)
    identity = Glacier2/router
    facet =
    operation = getClientProxy ]
    [ glacier2router: Network: closing tcp connection
    local address = 3.4.5.6:10005
    remote address = 3.4.5.6:33977 ]
  • mes
    mes California
    You mentioned that you're not using a default router, but the fact that the protocol tracing includes a request for the operation getClientProxy implies that routing is occurring (or at least being attempted).

    We'll need more information from you before we can resolve the problem. When you say "callback demo", do you mean demo/Ice/callback or demo/Glacier2/callback?

    Have you modified the client's configuration file? If so, what changes did you make? What changes did you make to Glacier2's configuration file?

    - Mark
  • Ok, so I've been messing around with the demo/Glacier2/callback client. With the only configuration changes being to add logging to glacier2, and with

    Ice.ObjectPrx proxy = communicator().stringToProxy("Glacer2/router:ssl -p 10005");/
    Ice.RouterPrx routerPrxy = Ice.RouterPrxHelper.checkedCast(proxy);

    in the top of run (before it goes and gets the default router from the config file), I get the following from glacier2, while my client throws the ConnectionLostException when it tries to do the checkedCast.
    [ glacier2router: Network: accepted ssl connection
      local address = 3.4.5.6:10005
      remote address = 3.4.5.6:55924 ]
    [ glacier2router: Protocol: sending validate connection
      message type = 3 (validate connection)
      compression status = 0 (not compressed; do not compress response, if any)
      message size = 14 ]
    [ glacier2router: Security: Performing handshake.
      local address = 3.4.5.6:10005
      remote address = 3.4.5.6:55924 ]
    [ glacier2router: Security: Performing handshake.
      local address = 3.4.5.6:10005
      remote address = 3.4.5.6:55924 ]
    [ glacier2router: Security: depth = 1:/C=US/ST=Some State/L=Somewhere/O=Your Company/OU=Development/CN=Your Certificate Authority/emailAddress=you@some.net
      verify return = 1
       ]
    [ glacier2router: Security: depth = 0:/C=US/ST=Some State/O=Your Company/OU=Development/CN=Ice Client
      verify return = 1
       ]
    [ glacier2router: Security: Performing handshake.
      local address = 3.4.5.6:10005
      remote address = 3.4.5.6:55924 ]
    [ glacier2router: Security: Performing handshake.
      local address = 3.4.5.6:10005
      remote address = 3.4.5.6:55924 ]
    [ glacier2router: Protocol: received request
      message type = 0 (request)
      compression status = 0 (not compressed; do not compress response, if any)
      message size = 64
      request id = 1
      identity = Glacer2/router
      facet =
      operation = ice_isA
      mode = 1 (nonmutating)
      context =  ]
    [ glacier2router: Protocol: sending reply
      message type = 2 (reply)
      compression status = 0 (not compressed; do not compress response, if any)
      message size = 43
      request id = 1
      reply status = 2 (object not exist)
      identity = Glacer2/router
      facet =
      operation = ice_isA ]
    [ glacier2router: Network: closing ssl connection
      local address = 3.4.5.6:32932
      remote address = <not connected> ]
    
  • mes
    mes California
    There are two problems here. First, you have misspelled the router's identity in your stringified proxy (change "Glacer2" to "Glacier2"). Second, the fact that Ice.Default.Router is defined means stringToProxy returns a routed proxy by default. You cannot use a routed proxy to interact directly with the router, which is what you're doing when you attempt to call checkedCast on this proxy.

    To fix this, you need to reset the router attribute of the proxy like this:
    Ice.RouterPrx routerPrxy =
        Ice.RouterPrxHelper.checkedCast(proxy.ice_router(null));
    
    Take care,
    - Mark