Archived

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

bug about exception definition

in my slice file, i define an exception:


"java : package:a.b.ice"

module demo
{

exception SessionException
{
string reason;
};

};

so i can generate the code into the package i wanted.

in order to test this situation, i throw the "SessionException" directly in the server side,
but the client side can't catch the SessionException,
and client can only catch the "Ice::UnmarshalOutOfBoundsException"

if i don't add this
"java : package:a.b.ice"

i can catch the "SessionException" as i expected.

so i think it's a bug, is it?

please let me know if i have made any mistake. thank you.

Comments

  • bernard
    bernard Jupiter, FL
    You typically get UnmarshalOutOfBoundsException when the Slice definitions used by your client and server are out of sync.

    Please make sure you rebuild property everything after changing your Slice!

    Cheers,
    Bernard
  • mes
    mes California
    canyoudink wrote:
    so i think it's a bug, is it?

    please let me know if i have made any mistake. thank you.
    It's not a bug. This is the expected behavior if you change the package mapping without informing the Ice run time about the change. The exception occurs because the run time receives "::demo::SessionException" over the wire as the type id of the exception, but is unable to automatically translate this into the actual class name a.b.ice.demo.SessionException and therefore UnmarshalOutOfBoundsException is raised.

    We added some configuration properties in Ice 2.0 that allow you to notify the Ice run time about changes to the package mapping. See section 10.15 of the Ice manual for more information.

    Take care,
    - Mark
  • problem solved

    great! the answer is in section 10.15,
    after i add the package configuration properties,
    it works!

    thank you for your quick response, as fast as ICE does! ;)