Archived
This forum has been archived. Please start a new discussion on GitHub.
user exception causes unmarshalling exception
Stuart Brodsky
in Help Center
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?
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?
0
Comments
-
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,
Mark0 -
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.0 -
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?0
-
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.0
-
The problem could also come from a GCC visibility flag, see http://www.zeroc.com/forums/bug-reports/4216-tcp-connection-timeouts-throw-exceptions-reconnecting-fails.html#post18600
If you're building with -fvisibility=hidden, remove this flag!
Best regards,
Bernard0
