Home Bug Reports

bug about exception definition

canyoudinkcanyoudink Member 陈海武Organization: jinan universityProject: casual game online
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

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
  • canyoudinkcanyoudink Member 陈海武Organization: jinan universityProject: casual game online
    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! ;)
Sign In or Register to comment.