kitodo / kitodo-production

Kitodo.Production is a workflow management tool for mass digitization and is part of the Kitodo Digital Library Suite.
http://www.kitodo.org/software/kitodoproduction/
GNU General Public License v3.0
62 stars 64 forks source link

NullPointerException while exporting using task manager #267

Closed henning-gerhardt closed 9 years ago

henning-gerhardt commented 9 years ago

Following NullPointerException is thrown while exporting:

java.lang.NullPointerException
    at de.sub.goobi.export.dms.ExportDms.imageDownload(ExportDms.java:561)
    at de.sub.goobi.export.dms.ExportDms.startExport(ExportDms.java:328)
    at de.sub.goobi.export.dms.ExportDms.startExport(ExportDms.java:165)
    at de.sub.goobi.helper.tasks.ExportDmsTask.run(ExportDmsTask.java:99)

Global property asynchronousAutomaticExport is set to true but project property for automatic export is set to false.

I did expect that if creation of destination directory fails whole export fails but all data are copied or exported.

matthias-ronge commented 9 years ago

Asynchronous DMS export is designed to export to DMS, not to user homes. Thus, setting asynchronousAutomaticExport to true but automatic export property to false won’t work. This is because the long running tasks are something not related to any logged in user. They work after you logged out and can be controlled by any user with sufficient privileges. They don’t have access to any Faces context and cannot detect “the” user.

The observed behaviour is odd since any exception during directory creation is being caught. So the export continues notwithstanding the message being shown (in synchronous mode) reads “export canceled”. The asynchronous mode behaves alike because it executes that code.

Correct behaviour should be:

henning-gerhardt commented 9 years ago

You are right but it was not clear to me that you must configure correct project properties if you want to use asynchronous export through task manager.

henning-gerhardt commented 9 years ago

Fixed