daitss/core — Issue #607: reject message: "end of file reached" when descriptor is present but invalid XML
Author: lydiam
Created: 2011-12-16 16:42:34+00:00
State: open

In working on enhancing reject messages for Affiliates I've found the following case that gives an "end of file reached" message and does not record a reject message. The descriptor file is correctly named, is XML, but is invalid XML. I would expect that this would be a not uncommon use case, and that DAITSS should record a reject and include the parser message.

My test case is on lanshare:\Digital Archive\D2 test packages - Lindsey\Ateam Test packages\ateam-descriptor-broken3.zip, and I'm submitting via the GUI.

The descriptor has the following validation error on darchive:
[lydiam@fclnx30 workspace]$ /opt/fda/bin/validate broken3.xml
java -Dwebcache=/var/daitss/webcache/ -Dfile=broken3.xml -jar /opt/daitss/lib/xmlvalidator.jar
Exception in thread "main" org.xml.sax.SAXParseException: The element type "fileGrp" must be terminated by the matching end-tag "".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
at edu.fcla.da.xml.Validator.validate(Unknown Source)
at edu.fcla.da.xml.Validator.main(Unknown Source)

I would have expected that this SIP would have rejected with the following error message:

"Exception in thread "main" org.xml.sax.SAXParseException: The element type "fileGrp" must be terminated by the matching end-tag ""."

We do have cases in the daitss_db of rejects with descriptor validation errors, I believe:

ECEZLN927_EZ1OGD (1828: cvc-attribute.3: The value 'JPEG82' of attribute 'ID' on element 'METS:file' is not
valid with respect to its type, 'ID'. )

EKS3VTUVF_LJJRD0 (3: TargetNamespace.1: Expecting namespace...)

The above were submitted via command-line.

I will tested my package via command-line submission on Ripple (as an Affiliate user):

-bash-3.2$ sudo -u daitss RUBYOPT=rubygems RUBY_HOME=/opt/ruby/bin GEM_BIN=/opt/ruby/gem-repos/bin GEM_HOME=/opt/ruby/gem-repos DAITSS_CONFIG=/opt/web-services/conf.d/daitss-config.yml VIRTUAL_HOSTNAME=core.ripple.fcla.edu PATH=/opt/ruby/bin:$PATH ./bin/submit-direct --username lydia_ACT --password lydia_ACT --path /var/daitss/ops/incoming/lydia/ateam-descriptor-broken3
[sudo] password for lydiam:

2011-12-16 11:33:54 ERROR No packages found in /var/daitss/ops/incoming/lydia/ateam-descriptor-broken3
-bash-3.2$ cd /var/daitss/ops/incoming/lydia/ateam-descriptor-broken3/

I got the same result as the root user.

As a double-check I sent the descriptor through the validator again:

-bash-3.2$ cd /var/daitss/ops/incoming/lydia/ateam-descriptor-broken3
-bash-3.2$ ls
ateam-descriptor-broken3.xml ateam.tiff
-bash-3.2$ /opt/fda/bin/validate ateam-descriptor-broken3.xml
java -Dwebcache=/var/daitss/webcache/ -Dfile=ateam-descriptor-broken3.xml -jar /opt/daitss/lib/xmlvalidator.jar
Exception in thread "main" org.xml.sax.SAXParseException: The element type "fileGrp" must be terminated by the matching end-tag "".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
at edu.fcla.da.xml.Validator.validate(Unknown Source)
at edu.fcla.da.xml.Validator.main(Unknown Source)

I can't seem to find any correctly named but invalid SIP descriptors that give anything but the above result, and I can no longer find the originals of the rejected packages found in daitss_db.

Has the code changed somehow?