Impossible to export Dictionary with attachments from TermWeb 3

Problem

Users cannot export dictionary with attachments, in server logs you can find next error stacktrace:

ERROR 2020-09-21 17:28:19,752 - User: 2i23r           experienced an error...
com.nescit.BaseException: java.lang.ArrayIndexOutOfBoundsException: 0
        at com.nescit.term.extern.ExportRunner.run(ExportRunner.java:40)
        at java.lang.Thread.run(Thread.java:745)
        at Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at com.nescit.term.extern.attachment.ZipExporter.writeAttachments(ZipExporter.java:125)
        at com.nescit.term.extern.attachment.ZipExporter.exportFile(ZipExporter.java:73)
        at com.nescit.term.extern.ExportManager.exportFile(ExportManager.java:159)
        at com.nescit.term.extern.ExportRunner.run(ExportRunner.java:34)

Solution

This error means into TermWeb has been uploaded file with unknown extension for system.

Two options to fix this:
1) this error has been fixed in TermWeb 4.0.5 and to avoid it in the future you need to update TermWeb.
2) fix file manually in database by specifying correct file extension.
3) as workaround you can delete error file attachment and upload file converted to supported file format.

Fixing manually in database or finding file attachments with unsupported file type:

  1. Execute next script to find which file attachment has unknown file extension

    SELECT a.oid, a.filepath, a.display_name, a.concept_oid, a.term_oid, d.name AS dictionary FROM tw_attachment a, tw_dictionaries d WHERE a.type = 0 AND a.dictionary_oid = d.oid;
  2. If you want to fix that files manually, you can open each concept or term where file attached by using next URLs:
    1) For TermWeb 3 installation:
    https://example.termweb.eu/termweb/view/${concept_oid} or https://example.termweb.eu/termweb/view/${concept_oid}/${term_oid}
    2) For TermWeb 4 installation:
    https://example.termweb.eu/view/${concept_oid} or https://example.termweb.eu/view/${concept_oid}/${term_oid}

  3. If you see in column “filepath” that file is in supported file types you can update it’s type by specifying right DB value.
    See below of this article list of supported file types.

  4. Most of changes should be applied automatically, in case of cached value, try to restart TermWeb.

List of supported file types TermWeb 4.0.5 and earlier releases.

File type

DB value

Supported file extensions

File type

DB value

Supported file extensions

UNKNOWN

0

<any other value>

WORD

1

doc

OPENDOC

2

odt

PDF

3

pdf

EXCEL

4

xls

HTML

5

htm, html

JPG

6

jpg, jpe, jpeg

GIF

7

gif

PNG

8

png

ZIP

9

zip

GZ

10

gz

AVI

11

avi

QUICKTIME

12

mov, qt

MPEG

13

mpeg, mpe, mpg

TEXT

14

txt

REALAUDIO

15

rm, ra, ram

WAV

16

wav

AU

17

au

MP3

18

mp3

M4A

19

m4a

RTF

20

rtf

POWERPOINT

21

ppt, ppz

WORDX

22

docx

EXCELX

23

xlsx

POWERPOINTX

24

pptx