|
Exceptions cannot be unmarshalled on client
When implementing an ICE service I ran inon an odd bug. It seems that ICE is not able to transfer errors correctly over the boundary of a library, at least under certain circumstances.
Appending you will find a ZIP file with a simple test scenario. It contains a precompiled server.exe which does nothing than throwing a bug. Furthermore there is a client_ok.exe which catches the bug correctly and a client_ko.exe which throws an Ice::UnmarshalOutOfBoundsException.
The only difference between client_ok.exe and client_ko.exe is that for client_ok.exe I removed the line
#define SHOW_ICE_EXCEPTION_BUG
from exceptions.ice. This made the exception appear in test.ice instead of exceptions.ice e voila - it works! I.M.H.O. it shouldn't matter in which .ice file an exception is defined as long as the generated .h / .cpp files are included correctly.
Another way to "solve" the problem was to compile all the objects directly into the executables rather than using an intermedate library (interface.lib, see the included Makefile).
This is really a weird bug and I hope you won't have too many problems to finally track it down. Though I have a workaround now it would be really nice if the bug could be removed in the next ICE version, so that I can tidy up my .ice files and more important, to safe others from this confusing phenomenon.
I used ICE 1.5.1 on Windows XP with Microsoft Visual Studio .NET 7.0. I verified the bug with ICE 1.3.0 as well. It occurred with standalone servers and IceBox servers, with or without debug libraries alike.
Last edited by robert : 10-15-2004 at 09:05 AM.
|