Results 1 to 10 of 10

Thread: user exception causes unmarshalling exception

  1. #1
    Stuart Brodsky is offline Registered User
    Name: Stuart Brodsky
    Organization: SGI
    Project: a framwork to support clustere management
    Join Date
    Aug 2008
    Posts
    6

    user exception causes unmarshalling exception

    I have an interesting case of cause where I can't get a user defined exception back to a client. i wind up getting an UnmarshalOutofBounds exception being returned.

    I have a client calling a server who then becomes a client to another server. This middle server/client is sending a synchronous command to the other server. Under normal conditions things work just fine but if a user defined exception is thrown at the end server, the server/client middle code sees an UnmarshalOutOfBounds exception and not the user exception. This middle server/client would like report the user exception back to the original client.

    I have a test case where the original client calls directly to the ending server bypassing the middle server/client and when an exception occurs, it does see the user thrown exception. The unmarshal error only occurs if I go through the middle server/client scenario.

    Everyone is using the same slice file definitions. Any ideas?

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    Hi Stuart,

    Have you reviewed our FAQ on this exception?

    If you're still having trouble, please describe your environment (including operating system, compiler, and Ice versions).

    Regards,
    Mark

  3. #3
    Stuart Brodsky is offline Registered User
    Name: Stuart Brodsky
    Organization: SGI
    Project: a framwork to support clustere management
    Join Date
    Aug 2008
    Posts
    6
    I am running SLED 10.2, gcc 4.2.1 with Ice 3.3.0. This is a 32 bit machine but it also fails on our x86 64 bit SLES 10.2 machines.

    Here is the slice definition for the exception:

    exception HalException
    {
    string reason;
    };
    exception NoPermissionException extends HalException
    {
    };

    The test client, the middle server/client and the end server all use this definition. I can't see the mis-match definitions between any client and server here.

  4. #4
    Stuart Brodsky is offline Registered User
    Name: Stuart Brodsky
    Organization: SGI
    Project: a framwork to support clustere management
    Join Date
    Aug 2008
    Posts
    6
    I ran my server with Trace.Slicing and it does show that the exception is an unknown exception. The server/client is built with .h file defining the the exception but for some reason when it receives the exception, doesn't know what it is.

  5. #5
    Stuart Brodsky is offline Registered User
    Name: Stuart Brodsky
    Organization: SGI
    Project: a framwork to support clustere management
    Join Date
    Aug 2008
    Posts
    6
    One other item to add is that I am not using the application class for my server/client code. My test code is uses the application class and that receives the user thrown exception correctly. What does the application class do that sets things up to know what a user thrown exception is?

  6. #6
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    The best thing to do is to post a complete self-compilable example that demonstrates your issue.

  7. #7
    Stuart Brodsky is offline Registered User
    Name: Stuart Brodsky
    Organization: SGI
    Project: a framwork to support clustere management
    Join Date
    Aug 2008
    Posts
    6
    What I have found is that my client/server code uses a .so library that is built using the same slice definition file. When built with the linked library, I get the marshalling error. However, when I take the modules and build them directly into my client/server code, it works just fine.

  8. #8
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    I'm not sure what you are doing wrong, but it is certainly possible to build the slice generated code into a shared library. After all, this is what the Ice runtime does (it builds the generated code for Router.ice, and other slice definitions into the runtime).

  9. #9
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    The problem could also come from a GCC visibility flag, see TCP connection timeouts throw exceptions and reconnecting fails

    If you're building with -fvisibility=hidden, remove this flag!

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  10. #10
    Stuart Brodsky is offline Registered User
    Name: Stuart Brodsky
    Organization: SGI
    Project: a framwork to support clustere management
    Join Date
    Aug 2008
    Posts
    6
    The problem lies in the fact that I do a slice2cpp in both the library and my code that links to the library. Somehow the exceptions get confused at that point. By only doing a slice2cpp once in the library and grabbing the .h files generated there, the code works.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem with user-defined exception
    By gregors in forum Help Center
    Replies: 1
    Last Post: 03-19-2009, 06:26 AM
  2. Can user selfdefine exception overload operator
    By sober in forum Help Center
    Replies: 2
    Last Post: 06-04-2008, 09:10 AM
  3. Replies: 4
    Last Post: 06-15-2007, 03:47 AM
  4. ICE user exception messages
    By chris in forum Help Center
    Replies: 1
    Last Post: 01-31-2005, 07:31 AM
  5. some problem about user exception
    By fishinmoon in forum Help Center
    Replies: 1
    Last Post: 09-08-2004, 01:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •