EOFException or NegativeArraySizeException error

31 views
Skip to first unread message

Skynett

unread,
Dec 14, 2021, 1:49:10 PM12/14/21
to xnat_discussion
Hi All,

I am runing XNAT 1.8.3 and have a project level anon script applied and I keep getting the error below when trying to store some Mammogram Images. Some are able to anonymize and archive successfully but others give 1 or 2 errors 

Error could be an EOFException error or a NegativeArraySizeException error, unfortunately the logs doesnt say much about the DICOM tag causing the issues.



org.nrg.dicom.mizer.exceptions.MizerException: org.nrg.transaction.TransactionException: java.lang.NegativeArraySizeException

2021-12-14 18:40:46,379 [DefaultMessageListenerContainer-9] ERROR org.nrg.xnat.helpers.merge.MergeSessionsA - An error occurred when anonymizing the data. This occurred prior to moving f
iles, so no rollback is performed.
org.nrg.dicom.mizer.exceptions.MizerException: org.nrg.transaction.TransactionException: java.lang.NegativeArraySizeException
        at org.nrg.dicom.mizer.service.impl.BaseMizerService.anonymize(BaseMizerService.java:286)
        at org.nrg.xnat.helpers.merge.AnonymizerA.anonymize(AnonymizerA.java:68)
        at org.nrg.xnat.helpers.merge.AnonymizerA.call(AnonymizerA.java:99)
        at org.nrg.xnat.helpers.merge.MergePrearcToArchiveSession.getPostAnonSession(MergePrearcToArchiveSession.java:160)
        at org.nrg.xnat.helpers.merge.MergePrearcToArchiveSession.getPostAnonSession(MergePrearcToArchiveSession.java:37)
        at org.nrg.xnat.helpers.merge.MergeSessionsA.call(MergeSessionsA.java:122)
        at org.nrg.xnat.archive.PrearcSessionArchiver.call(PrearcSessionArchiver.java:609)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase$12.extSync(PrearcDatabase.java:965)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase$12.extSync(PrearcDatabase.java:962)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase$LockAndSync.run(PrearcDatabase.java:1596)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase._archive(PrearcDatabase.java:988)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase.archive(PrearcDatabase.java:935)
        at org.nrg.xnat.helpers.prearchive.handlers.PrearchiveArchiveHandler.commitSessionToArchive(PrearchiveArchiveHandler.java:61)
        at org.nrg.xnat.helpers.prearchive.handlers.PrearchiveArchiveHandler.execute(PrearchiveArchiveHandler.java:47)
        at org.nrg.xnat.services.messaging.prearchive.PrearchiveOperationRequestListener.onRequest(PrearchiveOperationRequestListener.java:38)
        at sun.reflect.GeneratedMethodAccessor791.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:180)
        at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:112)
        at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:104)
        at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:69)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:719)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:679)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:649)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1167)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1159)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1056)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.nrg.transaction.TransactionException: java.lang.NegativeArraySizeException
        at org.nrg.transaction.operations.WorkOnCopyOp.run(WorkOnCopyOp.java:50)
        at org.nrg.transaction.Run.runTransaction(Run.java:17)
        at org.nrg.dicom.mizer.service.impl.BaseMizerService.anonymize(BaseMizerService.java:282)
        ... 30 common frames omitted
Caused by: java.lang.NegativeArraySizeException: null
        at org.dcm4che2.io.DicomInputStream.readBytes(DicomInputStream.java:657)
        at org.dcm4che2.io.DicomInputStream.readValue(DicomInputStream.java:590)
        at org.dcm4che2.io.DicomInputStream.parse(DicomInputStream.java:518)
        at org.dcm4che2.io.DicomInputStream.readDicomObject(DicomInputStream.java:415)
        at org.dcm4che2.io.DicomInputStream.readDicomObject(DicomInputStream.java:423)
        at org.nrg.dicom.mizer.service.impl.AnonymizeCallOnFileWithPixels.call(AnonymizeCallOnFileWithPixels.java:62)
        at org.nrg.dicom.mizer.service.impl.AnonymizeCallOnFileWithPixels.call(AnonymizeCallOnFileWithPixels.java:38)
        at org.nrg.transaction.operations.WorkOnCopyOp.run(WorkOnCopyOp.java:32)
        ... 32 common frames omitted


Any suggestion will be greatly appreciated.

Thanks

Moore, Charlie

unread,
Dec 14, 2021, 2:04:18 PM12/14/21
to xnat_di...@googlegroups.com
Hi there,

We would probably need your anon script and a non-sensitive sample study to recreate the issue. I don't really see anything in that stack trace that's specific enough.

Thanks,
Charlie

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of Skynett <say...@gmail.com>
Sent: Tuesday, December 14, 2021 12:49 PM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] EOFException or NegativeArraySizeException error
 

* External Email - Caution *

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/a35b82ac-55d2-46bc-9d02-4cfc7ab5889fn%40googlegroups.com.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Herrick, Rick

unread,
Dec 14, 2021, 3:44:55 PM12/14/21
to xnat_di...@googlegroups.com

Here’s something you can try. I’ve attached a really simple Groovy script to this post. You’ll need to install Groovy to run it, but that should be all you need (you can find instructions for installing Groovy here; I use SDKMAN myself, fwiw). Once you have Groovy installed, you can run this script like so:

 

groovy ValidateDicom.groovy /path/to/your/DICOM/data

 

The script will go to the folder you provide and walk the directory tree. Any files with the dcm extension that it finds it tries to open and read. That’s all it does, which should be sufficient because your stacktrace indicates that the operation is failing just on the call to DicomInputStream.readDicomObject().

 

This will write out results to a file name <folder>-validation.log. Files with read errors will look something like this:

 

ERROR IN /path/to/your/DICOM/data/1/1.dcm: java.lang.NegativeArraySizeException "null"

 

This won’t tell you what is wrong with those files, but will at least help you identify which ones are causing trouble.

 

-- 

Rick Herrick

XNAT Architect/Developer

Computational Imaging Laboratory

Washington University School of Medicine

ValidateDicom.groovy
Reply all
Reply to author
Forward
0 new messages