Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20460

It's possible to break many translations of a wiki

    XMLWordPrintable

Details

    • Unknown
    • N/A

    Description

      It's possible to break all translations coming from wiki pages in a wiki, if a user inserts a combination of objects in their user profile including a TranslationDocumentClass xobject.
      In this case at restart of the wiki a stacktrace like this will appear:

      com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:XWiki.renniepak1()]
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1155)
      	at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:395)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2184)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2246)
      	at org.xwiki.localization.wiki.internal.DocumentTranslationBundleFactory.loadTranslations(DocumentTranslationBundleFactory.java:230)
      	at org.xwiki.localization.wiki.internal.DocumentTranslationBundleFactory.initialize(DocumentTranslationBundleFactory.java:207)
      	at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
      	at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:365)
      	at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:451)
      	at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:201)
      	at org.xwiki.component.embed.GenericProvider.getInstance(GenericProvider.java:111)
      	at org.xwiki.component.embed.GenericProvider.get(GenericProvider.java:100)
      	at org.xwiki.localization.wiki.internal.DocumentTranslationBundleInitializer.onEvent(DocumentTranslationBundleInitializer.java:82)
      	at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:320)
      	at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:285)
      	at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
      	at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
      	at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:XWiki.Notifications.Code.ToggleableFilterPreferenceClass()]
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1155)
      	at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:395)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2184)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2246)
      	at com.xpn.xwiki.XWiki.getXClass(XWiki.java:7058)
      	at com.xpn.xwiki.objects.classes.BaseClass.newCustomClassInstance(BaseClass.java:1349)
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1088)
      	... 18 common frames omitted
      Caused by: com.xpn.xwiki.XWikiException: Error number 3212 in 3: Exception while loading object {0} of class {1} and number {2}
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiCollectionInternal(XWikiHibernateStore.java:1618)
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1103)
      	... 24 common frames omitted
      Caused by: com.xpn.xwiki.XWikiException: Error number 3212 in 3: Exception while loading object {0} of class {1}, number {2} and property {3}
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiCollectionInternal(XWikiHibernateStore.java:1594)
      	... 25 common frames omitted
      Caused by: com.xpn.xwiki.XWikiException: Error number 3212 in 3: Exception while loading property sheet of object XWiki.Notifications.Code.ToggleableFilterPreferenceClass
      	at com.xpn.xwiki.store.XWikiHibernateStore.lambda$loadXWikiProperty$7(XWikiHibernateStore.java:1751)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:826)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:902)
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiProperty(XWikiHibernateStore.java:1721)
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiCollectionInternal(XWikiHibernateStore.java:1559)
      	... 25 common frames omitted
      Caused by: org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [com.xpn.xwiki.objects.StringProperty#<property><sheet></sheet></property>]
      	at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219)
      	at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:327)
      	at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:108)
      	at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:74)
      	at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:118)
      	at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1231)
      	at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1220)
      	at org.hibernate.internal.SessionImpl.load(SessionImpl.java:996)
      	at org.hibernate.engine.spi.SessionDelegatorBaseImpl.load(SessionDelegatorBaseImpl.java:820)
      	at com.xpn.xwiki.store.XWikiHibernateStore.lambda$loadXWikiProperty$7(XWikiHibernateStore.java:1724)
      	... 29 common frames omitted
      
      

      and the translations won't be displayed anymore in places such as user profiles menu.
      Note that I've not been able to discover yet what combination of xobjects was triggering the bug, but the attached user profile in xar is able to reproduce the issue.

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            surli Simon Urli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: