Archived

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

C# exceptions

Hi,

When I call retrieve() with an non-existing topic name on my IceStorm TopicManager, I get a UnknownUserException rather than a NoSuchTopic exception. In C++ it works fine.

Do I have to do something special in C# to make this work? (We're not really using remote exceptions much so far, and I didn't make a small test-case yet).

Cheers,

Rob

Comments

  • Can you give us more details about the problem? What C# compiler are you using? What version of Ice? What is the content of the "unknown" field in the UnknownUserException? Do you have a code example that demonstrates the problems?
  • Hi Marc,
    marc wrote:
    Can you give us more details about the problem? What C# compiler are you using? What version of Ice? What is the content of the "unknown" field in the UnknownUserException? Do you have a code example that demonstrates the problems?

    Visual Studio 2003
    Ice 2.1.2
    The unknown field in Ice.UnknownException is null (what's this field?).

    The code is basically:
    TopicManagerPrx  topicManager = null;
    
        try
        {
            topicManager = TopicManagerPrxHelper.checkedCast
                 (communicator.stringToProxy ("IceStorm/TopicManager"));
    
            topicManager.retrieve ("bleh");
        }
        catch (Ice.Exception e)
        {
            ...
        }
    
    The retrieve() throws the UnknownUserException. Protocol dump on storm server side:

    (eh, this is actually for a related test, a create() of an existing topic that should throw TopicExists, but also throws UnknownUserException)


    [ IceStorm: Protocol: received request
    message type = 0 (request)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 71
    request id = 4
    identity = IceStorm/TopicManager
    facet =
    operation = create
    mode = 0 (normal)
    context = ]
    [ IceStorm: Protocol: sending reply
    message type = 2 (reply)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 69
    request id = 4
    reply status = 1 (user exception) ]
  • I tried this out and received the expected NoSuchTopic exception. Some additional details might help track down the problem.

    - Are you using an installed version of Ice from our Windows installer or did you build it yourself?

    - Is your example "all Windows" or are you using a different platform for your server?

    - Are all of the components used in your test built on Ice 2.1.2?
  • Hi Brent,
    beagles wrote:
    I tried this out and received the expected NoSuchTopic exception. Some additional details might help track down the problem.

    - Are you using an installed version of Ice from our Windows installer or did you build it yourself?

    - Is your example "all Windows" or are you using a different platform for your server?

    - Are all of the components used in your test built on Ice 2.1.2?
    - Using your installer
    - Same platform, same PC even.
    - Yes, all 2.1.2, unless something is badly broken in my setup :)

    So, the snippet shown below reports 'Exception: UnknownUserException'..
    ... get topicManager..
    
                try 
                {
                    topicManager.retrieve ("bleh");
                }            
                catch (IceStorm.NoSuchTopic ex) 
                {
                    MessageBox.Show ("bleh: " + ex.Message);
                }
                catch (Ice.Exception ex) 
                {
                    MessageBox.Show ("Exception: " + ex.Message);
                }
    
    No difference between debug mode and release mode.

    I wonder what's going on.. Would it help if I raise various Ice logging levels and report that to you?

    [I do have the sneaky suspicion this is going to be something embarrassing and silly :)]

    Cheers,

    Rob
  • matthew
    matthew NL, Canada
    My guess is that there is something going on with the server, not the client. Most likely for some reason it is causing an access violation.

    If you have compiled Ice yourself you could try running the icestorm server under debug mode after turning on "stop on access violations" (see last months connections for details on what unknown local exception means). Once you know what is going on then we can help fix whatever the problem is.
  • matthew wrote:
    My guess is that there is something going on with the server, not the client. Most likely for some reason it is causing an access violation.

    If you have compiled Ice yourself you could try running the icestorm server under debug mode after turning on "stop on access violations" (see last months connections for details on what unknown local exception means). Once you know what is going on then we can help fix whatever the problem is.

    Since the log says that a UserException is being sent to the client, I do not believe that it is a server-side issue. The exception is being sent, but for some reason the client isn't aware of this exception type...
  • Could you post self-contained example that illustrates the problem? I'm afraid that, without a test case, it will be very difficult for us to figure out what is going wrong...

    Thanks,

    Michi.