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

DW is wrongly started after the creation of a wiki using a template

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.4
    • 5.4-rc-1
    • Wiki
    • None
    • Unknown
    • N/A
    • N/A

    Description

      This is due to the fact that the event WikiCopiedEvent is not sent, so the DW did not copy is own index.

      WikiCopiedEvent is not sent because there is an exception in DefaultWikiCopier:

      g.xwiki.wiki.manager.WikiManagerException: Failed to copy document.
      	at org.xwiki.wiki.internal.manager.DefaultWikiCopier.copyDocuments(DefaultWikiCopier.java:103)
      	at org.xwiki.wiki.template.internal.TemplateWikiProvisioningJob.runInternal(TemplateWikiProvisioningJob.java:79)
      	at org.xwiki.job.internal.AbstractJob.run(AbstractJob.java:154)
      	at org.xwiki.context.concurrent.ExecutionContextRunnable.run(ExecutionContextRunnable.java:70)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1266)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1346)
      	at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore.saveToRecycleBin(XWikiHibernateRecycleBinStore.java:123)
      	at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3801)
      	at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3776)
      	at com.xpn.xwiki.XWiki.copyDocument(XWiki.java:3963)
      	at com.xpn.xwiki.XWiki.copyDocument(XWiki.java:3930)
      	at org.xwiki.wiki.internal.manager.DefaultWikiCopier.copyDocuments(DefaultWikiCopier.java:93)
      	... 6 more
      Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.xpn.xwiki.doc.XWikiDeletedDocument]
      	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
      	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      	at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2345)
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2852)
      	at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
      	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
      	at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
      	at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
      	at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
      	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
      	at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
      	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
      	at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
      	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
      	at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
      	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
      	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
      	at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore$1.doInHibernate(XWikiHibernateRecycleBinStore.java:128)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1260)
      	... 13 more
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'AnnotationCode.Translations--2014-02-04 11:27:44' for key 'XDD_FULLNAME'
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      	at com.mysql.jdbc.Util.getInstance(Util.java:386)
      	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2825)
      	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2441)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2366)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2350)
      	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      	at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
      	at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
      	... 30 more
      

      (it was trying to copy AnnotationCode.Translations--2014-02-04 11:27:44.)

      Possible cause:
      in DefaultWikiCopier, we try to copy the same document several times: when xwiki#copyDocument() has to copy a document that already exists in the target wiki, it deletes it before. If it tries to delete the same document twice during in a second, then the computed name for the recycle bin is duplicate and the database refuses to store the new row.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              gdelhumeau Guillaume Delhumeau
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: