Error in creating an annotation
ewg118 opened this issue · comments
I am testing the deployment of 1.0.1 (Java 11) release. I have deployed Solr 8.6.2, though I don't believe this is the problem.
java -version
openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)
I load a manifest and then go to a canvas. I can see SAS triggers a Solr query for annotations related to the canvas:
2020-09-14 15:26:03.716 INFO (qtp286649365-17) [ x:annotations] o.a.s.c.S.Request [annotations] webapp=/solr path=/select params={q=target:http\://numismatics.org/archives/manifest/schaefer.rrdp.b01/canvas/schaefer_012-01_b01_p010&fl=id,type,motivation,body,target,selector,short_id,within,data,canvas&start=0&rows=1000&wt=javabin&version=2} hits=0 status=0 QTime=0
I then create an annotation. The SAS log shows some JSON-LD representing the annotation (attached error.log).
error.log.
The gist is this:
2020-09-14 11:27:37.847:WARN:oejs.HttpChannel:qtp1161082381-13: /annotation/create java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')
I can see that SAS posts an update to Solr:
2020-09-14 15:27:37.346 INFO (qtp286649365-41) [ x:annotations] o.a.s.u.p.LogUpdateProcessorFactory [annotations] webapp=/solr path=/update params={wt=javabin&version=2}{add=[http://localhost:8888/annotation/1600097257325 (1677823581714644992)]} 0 5
The Solr panel does indeed show a new doc (attached solr.doc.txt
solr.doc.txt
)
The "data" property seems to be a base64 encoded alphanumeric string. Is this correct?
When I return to the page (click to new page and click back or reload the manifest and start over from scratch), I see that SAS executes a Solr query:
2020-09-14 15:38:33.830 INFO (qtp286649365-21) [ x:annotations] o.a.s.c.S.Request [annotations] webapp=/solr path=/select params={q=target:http\://numismatics.org/archives/manifest/schaefer.rrdp.b01/canvas/schaefer_012-01_b01_p010&fl=id,type,motivation,body,target,selector,short_id,within,data,canvas&start=1&rows=1000&wt=javabin&version=2} hits=1 status=0 QTime=0
which indicates there is one annotation on this canvas, but I'm getting the same SAS error as before:
2020-09-14 11:38:33.831:WARN:oejs.HttpChannel:qtp1161082381-140: /annotation/search java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')
So it seems the annotation is getting created (correctly?) in Solr, but something is getting garbled in between extracting the annotation back from Solr and rendering it in Mirador in SAS. Do you think I should downgrade to Solr 6.x, or is this something else entirely?
Let me create a new release. This looks to be fixed in master but not in the 1.0.1 release.
The new release is available here:
https://github.com/glenrobson/SimpleAnnotationServer/releases/tag/1.0.2
Please re-open if your still getting problems.
Thanks, it works! Please let me know if you plan to migrate to Mirador 3.
Thats great news!
Regarding Mirador 3, it is something I hope to do but until then @robcast has the following adapter for Mirador 3:
https://github.com/robcast/mirador-annotations/blob/master/src/SimpleAnnotationServerV2Adapter.js