Archived
This forum has been archived. Please start a new discussion on GitHub.
\ in Identity
hi,
i have some issue with Ice.Identity and the utility functions.
Galcier2 is creating a random category for callbacks.
This category can contain \.
I use ice_toString() on a callback proxy to save it to a file for persistency.
In cases of restart the I get an ObjectNotExistException, because the object
identity's category is wrong.
Object Identity before restart: 2z7l\\FVtJvuQbiv+ZN\']/CommonObserver
Object Identity after restart: 2z7l\\\\FVtJvuQbiv+ZN\\\']/CommonObserver
I wrote a small app to show the Identity issue:
Any idea?
THX & CU
Tom
i have some issue with Ice.Identity and the utility functions.
Galcier2 is creating a random category for callbacks.
This category can contain \.
I use ice_toString() on a callback proxy to save it to a file for persistency.
In cases of restart the I get an ObjectNotExistException, because the object
identity's category is wrong.
Object Identity before restart: 2z7l\\FVtJvuQbiv+ZN\']/CommonObserver
Object Identity after restart: 2z7l\\\\FVtJvuQbiv+ZN\\\']/CommonObserver
I wrote a small app to show the Identity issue:
using System; using System.Collections.Generic; using System.Text; namespace IceIdentity { class Program { static void Main( string[] args ) { Ice.Identity id = new Ice.Identity( "some name", @"some\category" ); string idstr = Ice.Util.identityToString( id ); Ice.Identity new_id = Ice.Util.stringToIdentity( idstr ); Console.WriteLine( "Ice.Identify: {0} {1}", id.name, id.category ); Console.WriteLine( "String of Ice.Identify: {0}", idstr ); Console.WriteLine( "Ice.Identify: {0} {1}", new_id.name, new_id.category ); } } }
Any idea?
THX & CU
Tom
0
Comments
-
if you only want to generate random category ids you can use IceUtil::generateUUID() this works like a charm.
I don't know if character '\' is valid for the id.name or id.category have you try to scape it '\\'0 -
xdm wrote:if you only want to generate random category ids you can use IceUtil::generateUUID() this works like a charm.
I don't know if character '\' is valid for the id.name or id.category have you try to scape it '\\'
hi xdm,
the category is generated by glacier2 - there is nothing i can do about this.
according to the ice manual '\' is a valid char.
i was debugging throught the code. looks like the method unescapeString
is not doing as expected.
cu tom0