[Archivesspace_Users_Group] FW: Unable to create Accession Report in PDF

Patrick Milhoan pmilhoan at nd.edu
Mon Jul 29 09:36:36 EDT 2019


Hi everyone,

I am having the same issue and I am not sure it is related to the use of
ampersands at all. I created a test accession record and gave it a
collection name of "Test" and unique ID of "123456789" with all other
fields blank and am still getting the error message below. Please note that
I am using the "Created Accessions" report and limiting the data range to
only generate a pdf of the test accession.

Can't load the XML resource (using TRaX transformer).
org.xml.sax.SAXParseException; lineNumber: 214; columnNumber: 71; The
entity name must immediately follow the '&' in the entity reference.
org.xhtmlrenderer.resource.XMLResource$XMLResourceBuilder.createXMLResource(org/xhtmlrenderer/resource/XMLResource.java:191)
org.xhtmlrenderer.resource.XMLResource.load(org/xhtmlrenderer/resource/XMLResource.java:71)
org.xhtmlrenderer.swing.NaiveUserAgent.getXMLResource(org/xhtmlrenderer/swing/NaiveUserAgent.java:211)
org.xhtmlrenderer.pdf.ITextRenderer.loadDocument(org/xhtmlrenderer/pdf/ITextRenderer.java:134)
org.xhtmlrenderer.pdf.ITextRenderer.setDocument(org/xhtmlrenderer/pdf/ITextRenderer.java:149)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:453)
org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:314)
RUBY.generate_pdf(/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/reports/report_generator.rb:54)
RUBY.generate(/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/reports/report_generator.rb:26)
RUBY.run(/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/job_runners/reports_runner.rb:39)
archivesspace.data.tmp.jetty_minus_0_dot_0_dot_0_dot_0_minus_8089_minus_backend_dot_war_minus___minus_any_minus_.webapp.WEB_minus_INF.app.lib.background_job_queue.invokeOther45:run(archivesspace/data/tmp/jetty_minus_0_dot_0_dot_0_dot_0_minus_8089_minus_backend_dot_war_minus___minus_any_minus_/webapp/WEB_minus_INF/app/lib//archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/background_job_queue.rb:126)
archivesspace.data.tmp.jetty_minus_0_dot_0_dot_0_dot_0_minus_8089_minus_backend_dot_war_minus___minus_any_minus_.webapp.WEB_minus_INF.app.lib.background_job_queue.run_pending_job(/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/background_job_queue.rb:126)
RUBY.block in
start_background_thread(/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/background_job_queue.rb:169)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:246)
java.lang.Thread.run(java/lang/Thread.java:748) Done.


Screen shot of accession record below:

[image: Screen Shot 2019-07-29 at 9.34.46 AM.png]

Thanks for taking a look at this.

-Patrick

On Fri, Jul 26, 2019 at 5:24 PM Majewski, Steven Dennis (sdm7g) <
sdm7g at virginia.edu> wrote:

> Not yet sure my diagnosis was correct. Looks like there is an xml_clean!()
>  Function:
>
>
> https://github.com/archivesspace/archivesspace/blob/master/backend/app/lib/reports/report_generator.rb#L104
>
>
> That gets called in the view template for PDF output:
>
> https://github.com/archivesspace/archivesspace/blob/master/backend/app/views/reports/report_content.erb#L1-L4
>
>
> So we need to investigate further and see if it’s working as intended.
> ( meanwhile: I’m getting MariaDB errors trying to run reports… [other
> thread] )
>
> — Steve.
>
>
>
>
>
> On Jul 26, 2019, at 5:08 PM, Zhang, Bin <bzhang at csus.edu> wrote:
>
> Thanks Steven and Blake!  Now can someone with power fix this soon?
>
> ---
> Bin Zhang
> Digital Information Services Librarian
> Library Systems & IT Services, University Library
> California State University, Sacramento
> +1 (916) 278-5664 | bzhang at csus.edu
> Zoom: https://csus.zoom.us/my/ <https://csus.zoom.us/my/bzhang>*bzhang
> <https://csus.zoom.us/my/bzhang>*
>
>
>
> *From: *<archivesspace_users_group-bounces at lyralists.lyrasis.org> on
> behalf of "Majewski, Steven Dennis (sdm7g)" <sdm7g at virginia.edu>
> *Reply-To: *Archivesspace Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Date: *Friday, July 26, 2019 at 10:14 AM
> *To: *Archivesspace Group <archivesspace_users_group at lyralists.lyrasis.org
> >
> *Subject: *Re: [Archivesspace_Users_Group] FW: Unable to create Accession
> Report in PDF
>
> v2.6.0 added a fix for the dreaded unescaped ampersands in EAD export (
> and PDF export from staff interface, which generates EAD and transforms to
> PDF, where malformed XML in the export stage is the usually problem when
> PDF export fails. ),
>
>
> https://github.com/archivesspace/archivesspace/commit/18f2f5100e8aa4510c61158a9accf279fb60e895
>
>
>  but I don’t think it will fix this issue in the report generator.
>
> I think adding some code to this clean_invalid_xml_characters() function
> to detect and escape unescaped ampersands might be the place to fix it:
>
>
> https://github.com/archivesspace/archivesspace/blob/master/backend/app/lib/reports/report_generator.rb#L126-L136
>
>
>
> — Steve.
>
>
>
> On Jul 26, 2019, at 1:03 PM, Blake Carver <blake.carver at lyrasis.org>
> wrote:
>
> What version are you running? There's a bunch of fixes in the new version
> for the dreaded ampersands!
> ------------------------------
> *From:* archivesspace_users_group-bounces at lyralists.lyrasis.org <
> archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of
> Zhang, Bin <bzhang at csus.edu>
> *Sent:* Friday, July 26, 2019 12:31 PM
> *To:* Archivesspace Users Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Subject:* Re: [Archivesspace_Users_Group] FW: Unable to create Accession
> Report in PDF
>
> Thanks Blake!  We do have “&” in accession records (in title and various
> other fields).  It’s going to be a lot of work to replace all of them.  Is
> this something the software can look for and take care of?  We were able to
> get the same report in other formats with no problem (JSON, RTF, HTML).
>
> --
> Bin
>
> *From: *<archivesspace_users_group-bounces at lyralists.lyrasis.org> on
> behalf of Blake Carver <blake.carver at lyrasis.org>
> *Reply-To: *Archivesspace Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Date: *Thursday, July 25, 2019 at 2:15 PM
> *To: *Archivesspace Group <archivesspace_users_group at lyralists.lyrasis.org
> >
> *Subject: *Re: [Archivesspace_Users_Group] FW: Unable to create Accession
> Report in PDF
>
>
> "The entity name must immediately follow the '&' in the entity reference."
>
> That makes me think there's an ampersand in that record and it's choking
> on it when it tries to make the PDF.
>
> Is there anything in there with ampersands? Like "J&J Automotive" or
> something?
> ------------------------------
> *From:* archivesspace_users_group-bounces at lyralists.lyrasis.org <
> archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of
> Zhang, Bin <bzhang at csus.edu>
> *Sent:* Thursday, July 25, 2019 4:26 PM
> *To:* Archivesspace Group <archivesspace_users_group at lyralists.lyrasis.org
> >
> *Subject:* [Archivesspace_Users_Group] FW: Unable to create Accession
> Report in PDF
>
> We are having problem creating Accession Report in PDF format.  All other
> formats (JSON, CSV, RTF) are working, just not the PDF format.  I have
> attached log below.
>
> Any help is greatly appreciated.
>
> Bin
>
> Log
> Follow Log
>
> Generating report
>
> Can't load the XML resource (using TRaX transformer).
> org.xml.sax.SAXParseException; lineNumber: 316990; columnNumber: 95; The
> entity name must immediately follow the '&' in the entity reference.
>
>
> org.xhtmlrenderer.resource.XMLResource$XMLResourceBuilder.createXMLResource(org/xhtmlrenderer/resource/XMLResource.java:191)
>
>
> org.xhtmlrenderer.resource.XMLResource.load(org/xhtmlrenderer/resource/XMLResource.java:71)
>
>
> org.xhtmlrenderer.swing.NaiveUserAgent.getXMLResource(org/xhtmlrenderer/swing/NaiveUserAgent.java:211)
>
>
> org.xhtmlrenderer.pdf.ITextRenderer.loadDocument(org/xhtmlrenderer/pdf/ITextRenderer.java:134)
>
>
> org.xhtmlrenderer.pdf.ITextRenderer.setDocument(org/xhtmlrenderer/pdf/ITextRenderer.java:149)
>
> java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
>
>
> org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:453)
>
>
> org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:314)
>
>
> RUBY.generate_pdf(/data/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/reports/report_generator.rb:54)
>
>
> RUBY.generate(/data/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/reports/report_generator.rb:26)
>
>
> RUBY.run(/data/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/job_runners/reports_runner.rb:39)
>
>
> data.archivesspace.data.tmp.jetty_minus_0_dot_0_dot_0_dot_0_minus_8089_minus_backend_dot_war_minus___minus_any_minus_.webapp.WEB_minus_INF.app.lib.background_job_queue.invokeOther45:run(data/archivesspace/data/tmp/jetty_minus_0_dot_0_dot_0_dot_0_minus_8089_minus_backend_dot_war_minus___minus_any_minus_/webapp/WEB_minus_INF/app/lib//data/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/background_job_queue.rb:126)
>
>
> data.archivesspace.data.tmp.jetty_minus_0_dot_0_dot_0_dot_0_minus_8089_minus_backend_dot_war_minus___minus_any_minus_.webapp.WEB_minus_INF.app.lib.background_job_queue.run_pending_job(/data/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/background_job_queue.rb:126)
>
> RUBY.block in
> start_background_thread(/data/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/background_job_queue.rb:169)
>
> org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
>
> org.jruby.RubyProc.call(org/jruby/RubyProc.java:246)
>
> java.lang.Thread.run(java/lang/Thread.java:748)
>
> Done.
>
>
> ---
> Bin Zhang
> Digital Information Services Librarian
> Library Systems & IT Services, University Library
> California State University, Sacramento
> +1 (916) 278-5664 | bzhang at csus.edu
> Zoom: https://csus.zoom.us/my/*bzhang*
>
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>
>
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>


-- 
*Patrick D. Milhoan*
*Lead Processing Archivist*
*Hesburgh Libraries*


*University of Notre Dame*
607 Hesburgh Library
Notre Dame, IN 46556
*t:* 574-631-9348
*e: *pmilhoan at nd.edu

<http://library.nd.edu/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20190729/3c2056dc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-07-29 at 9.34.46 AM.png
Type: image/png
Size: 36604 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20190729/3c2056dc/attachment.png>


More information about the Archivesspace_Users_Group mailing list