Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-8538

Fix NPE in nuxeo-platform-importer addon when multi threaded

    XMLWordPrintable

    Details

      Description

      NPE is raised when trying to access session from a document model.

      This happens when the session of the root document has been closed by another thread/task.

      The root document of a new thread/task must be re/attached with the task session.

      7:37,171 [pool-1-thread-2] ERROR [NUXEO:base.GenericThreadedImportTask] Unable to create leaf document for /home/....xml:java.lang.NullPointerException
      16:47:37,171 [pool-1-thread-2] ERROR [NUXEO:base.GenericThreadedImportTask] Error during import
      java.lang.Exception: java.lang.NullPointerException
      	at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.doCreateLeafNode(GenericThreadedImportTask.java:223)
      	at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.recursiveCreateDocumentFromNode(GenericThreadedImportTask.java:330)
      	at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.recursiveCreateDocumentFromNode(GenericThreadedImportTask.java:325)
      	at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.run(GenericThreadedImportTask.java:366)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
      	at org.nuxeo.ecm.core.api.CoreInstance.getSession(CoreInstance.java:223)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getCoreSession(DocumentModelImpl.java:403)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl$RunWithCoreSession.execute(DocumentModelImpl.java:440)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getACP(DocumentModelImpl.java:878)
      	at ...
      org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.doCreateLeafNode(GenericThreadedImportTask.java:215)
      	... 6 more
      

        Attachments

          Activity

            People

            • Assignee:
              bdelbosc Benoit Delbosc
              Reporter:
              bdelbosc Benoit Delbosc
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: