Home Help Center


changchang Member shen changOrganization: nasaProject: AMO HDU ✭✭
Hi All
I have two window programs. One is for publish and monitoring (X), another is subscriber (Y). I have an exception which I could not understand.

When Y starts, there is a button B to initialize IceStorm Topic proxy, Listener Adpator, etc.
When X starts, it first initial everything of publisher and subscriber.

If I start the Y first, then click the button B to start Listening. Then start X. I will got the exception error below: (But the code was generated by Ice add-on automatically.)

But if I start X first and then start Y. No error.

I could not find where is the problem and cannot set try-catch to find where the error comes from.

exception error:
Ice.EncapsulationException was unhandled by user code
Message=Exception of type 'Ice.EncapsulationException' was thrown.
at IceInternal.BasicStream.endReadEncaps()
at IceInternal.Incoming.endReadParams()
at myiceDisp_.transfer___(afts obj__, Incoming inS__, Current current__) in myice.cs:line 1594
at myiceDisp_.dispatch__(Incoming inS__, Current current__) in myice.cs:line 1637
at IceInternal.Incoming.invoke(ServantManager servantManager, BasicStream stream)

the exception is in the second line
obj__.transfer(message, current__);

ice file:
module myice
const string Name = "name";
sequence<long> seqLong;
sequence<double> seqDouble;
sequence<short> seqChar;
sequence<byte> seqRawChar;
sequence<string> seqDiagnosis;
sequence<string> seqOptions;
sequence<string> seqProcedures;
sequence<bool> seqBoolean;

struct MessageHeader
double gmt;
long srcId;
long destId;
long instId;
double pubInterval;
bool xportFlg;
short bridge;

struct myiceData
short modifier;
short charCnt;
seqChar chars;
short intCnt;
seqLong ints;
short realCnt;
seqDouble reals;

struct myiceMessage
MessageHeader hdr;
myiceData data;

interface afts {
void transfer(myiceMessage message);


  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    This exception typically indicates that there's a mismatch between the Slice used by the client and the one used by the server. Could you ensure that the subscriber and publisher are using the same Slice, the generated code is up to date and that you've rebuilt both of them?

    If this is still not working, could try to reproduce the problem with a sample test case? You can for example try reproduce it by modifying the IceStorm/clock demo provided with your Ice distribution.

    Btw, which Ice version do you use?

  • changchang Member shen changOrganization: nasaProject: AMO HDU ✭✭

    Thanks Benoit

    version is 3.5.1
    C# MSVS 2013
    Both use same slice file to build.

    I will do more test once I finish something in hand which needs to be finished at theend of the year. I will post the test early next month.

    Actually all ice stuff was build in a Dll and both program call that Dll. So I would like to think they use same slice file.

Sign In or Register to comment.