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

ORA-01400: cannot insert NULL into ("XWIKI"."XWIKIDOCUMENTINDEXINGQUEUE"."XWT_VERSION") when creating an instance on Oracle

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 14.2.1, 14.3-rc-1
    • 14.2-rc-1
    • Index
    • Windows 11 Pro 64 bit, Edge 99, using a local instance of XWiki 14.2 RC1 on Oracle 19c, Tomcat 9.0.60
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Configure an instance of XWiki 14.2 RC1 with Oracle 19c (I've tested with both ojdbc8-19.3.0.0.jar and ojdbc8.jar (downloaded from https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html)
      2. Start XWiki
      3. After startup, access the instance

      EXPECTED RESULTS

      The Distribution Wizard opens with no errors and the instance can be created successfully.

      ACTUAL RESULTS

      As soon as the instance is accessed in browser, an error is displayed multiple times in XWiki console: 

      2022-03-28 13:32:29,836 [XWiki initialization] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Error: 1400, SQLState: 23000
      2022-03-28 13:32:29,836 [XWiki initialization] ERROR o.h.e.j.s.SqlExceptionHelper   - ORA-01400: nu poate fi inserat NULL εn ("XWIKI"."XWIKIDOCUMENTINDEXINGQUEUE"."XWT_VERSION")
      
      2022-03-28 13:32:29,839 [XWiki initialization] ERROR .x.x.s.XWikiHibernateBaseStore - Exception while close transaction
      javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
              at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1406)
              at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:493)
              at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3285)
              at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2420)
              at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:449)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:40)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281)
              at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101)
              at com.xpn.xwiki.internal.store.hibernate.HibernateStore.endTransaction(HibernateStore.java:880)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:830)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:934)
              at org.xwiki.index.internal.TasksStore.lambda$addTask$3(TasksStore.java:85)
              at org.xwiki.index.internal.TasksStore.initWikiContext(TasksStore.java:170)
              at org.xwiki.index.internal.TasksStore.addTask(TasksStore.java:84)
              at org.xwiki.index.internal.DefaultTasksManager.addTask(DefaultTasksManager.java:136)
              at org.xwiki.index.internal.DefaultTasksManager.addTask(DefaultTasksManager.java:126)
              at org.xwiki.index.internal.listener.LinksUpdateListener.onEvent(LinksUpdateListener.java:74)
              at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:320)
              at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:285)
              at com.xpn.xwiki.XWiki.afterSave(XWiki.java:1986)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2066)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1954)
              at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1415)
              at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1379)
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1288)
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1225)
              at com.xpn.xwiki.XWiki.<init>(XWiki.java:1198)
              at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
              at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:243)
              at org.xwiki.job.AbstractJob.run(AbstractJob.java:220)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
              at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:59)
              at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37)
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
              at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200)
              at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3381)
              at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3908)
              at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:107)
              at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
              at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)
              at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
              at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475)
              at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:344)
              at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40)
              at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
              at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1402)
              ... 31 common frames omitted
      Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: nu poate fi inserat NULL εn ("XWIKI"."XWIKIDOCUMENTINDEXINGQUEUE"."XWT_VERSION")
      
              at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509)
              at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461)
              at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104)
              at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550)
              at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268)
              at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:655)
              at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:270)
              at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:91)
              at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970)
              at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1205)
              at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3666)
              at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1426)
              at oracle.jdbc.driver.OraclePreparedStatement.executeLargeUpdate(OraclePreparedStatement.java:3756)
              at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3736)
              at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1063)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
              ... 42 common frames omitted
      Caused by: oracle.jdbc.OracleDatabaseException: ORA-01400: nu poate fi inserat NULL εn ("XWIKI"."XWIKIDOCUMENTINDEXINGQUEUE"."XWT_VERSION")
      
              at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513)
              ... 60 common frames omitted

      The error is "ORA-01400: cannot insert null into (string)".

      Despite the errors occurring, Distribution Wizard opens and can be completed to the end.

      Also, the error is encountered when creating a subwiki as well (see screenshot).

      The issue could not be reproduced on XWiki 14.1 and XWiki 14.0 (which was smoke tested on Oracle 19c).

      Attachments

        1. Oracle_DW_error.png
          88 kB
          Ilie Andriuta
        2. Oracle_subwiki_error.png
          62 kB
          Ilie Andriuta

        Issue Links

          Activity

            People

              mleduc Manuel Leduc
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: