This has happen to me in the following circonstances, but there is many other possibilities:
1) Created a new wiki, importing the latest XE xar
2) Imported an old WebPreference page (comming from 2.4) into myspace
3) Edit the some preferences in the Admin application, which cause XWiki.XWikiPreferences to be saved
4) Get an expception (Exception while saving document mywiki:XWiki.XWikiPreferences Wrapped Exception: For input string: "yes")
After debugging, we had found two issues:
1) the migration of broken properties happend on all documents, not the saved one. So while I was saving XWiki.XWikiPreferences, it was breaking on a property of myspace.WebPreferences, which prevent me to save XWiki.XWikiPreferences. This is obviously really bad.
2) while the "showhistory" preference was previously a String, and is now a boolean, it breaks on fixing it while doing a props.fromString("yes") which in fact cause for a boolean an new Integer("yes"). Since the yes is in the database already, imported previously, the only workaround is to delete the offending document.