Using objects as keys is probably not a good idea. musachy
On Tue, Nov 11, 2008 at 6:25 PM, Relph,Brian <[EMAIL PROTECTED]> wrote: > > Hello, I am trying to use the JSON plugin in my struts2 application. I am > getting a parser error on the string returned from the server. I think the > plugin is having problems converting my Map to JSON. > > Here is my object that I am trying to convert to JSON: > > *public** class** RoleDetails** extends* RoleImpl { > > * private* List<Role> directParents; > > * private* Map<Role, Set<Identity>> transitiveParentsWithSources; > > * private* List<Role> directChildren; > > * private* Map<Role, Set<Identity>> transitiveChildrenWithSources; > > * private* List<Group> directGroupChildren; > > * private* Map<Group, Set<Identity>> > transitiveGroupChildrenWithSources; > > * private* List<String> directUsernames; > > * private* Map<String, Set<Identity>> > transitiveUsernamesWithSources; > > * private* List<Permission> directPermissionParents; > > * private* Map<Permission, Set<Identity>> > transitivePermissionParentsWithSources; > > I have attached the output from one of my requests, but it is pretty long, > here is the portion where the json compiler explodes: > > <<json.txt>> > > "transitiveChildrenWithSources":{},"transitiveGroupChildrenWithSources":*ERROR > HERE*{{"description":"super > users","groupNames":[],"name":"hin_wasadmins","usernames":["ar016581","temp_wasadmin","admin_usertool","relphie","bgraves","newtestuser","fk3794","samkarl","test_usertool","kp016678","bo017459","bk016677","rw012795","kchintan","kp014672"]}:[{"description":"Health > Management > Advisor","groupNames":["hin_wasadmins"],"name":"HHM_Advisor","usernames":["testuser13","kp016678","hmadvisor1","hmadvisor2_cert","hmadvisor1_cert","hmadvisor2","hmadvisor3","hmadvsr2","hmadvisor3_cert","hmadvsr1","hmadvsr3"]}]} > > So it looks like there is either a problem with my map keyed by object, or > the transitiveChildrenWithSources map being empty. Any thoughts? > > *Brian Relph* | Software Engineer | Cerner Corporation | 816-201-7642 | ** > [EMAIL PROTECTED] <[EMAIL PROTECTED]> | > ***www.cerner.com*<http://www.cerner.com> > ------------------------------ > CONFIDENTIALITY NOTICE This message and any included attachments are from > Cerner Corporation and are intended only for the addressee. The information > contained in this message is confidential and may constitute inside or > non-public information under international, federal, or state securities > laws. Unauthorized forwarding, printing, copying, distribution, or use of > such information is strictly prohibited and may be unlawful. If you are not > the addressee, please promptly delete this message and notify the sender of > the delivery error by e-mail or you may call Cerner's corporate offices in > Kansas City, Missouri, U.S.A at (+1) (816)221-1024. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- "Hey you! Would you help me to carry the stone?" Pink Floyd