Closed bencomp closed 6 years ago
I tried changing the context URLs in some of the test files, but that didn't help.
Searching for "Jena riot invalid remote context" brought me to this issue: https://issues.apache.org/jira/browse/JENA-1178. Old versions of Jena use outdated versions of HTTPClient that cannot handle HTTPS (well). Perhaps it is time to update some dependencies?
On a first try on a new branch, I found:
mvn versions:use-latest-releases
to update all dependencies to their latest releasescom.hp.hpl.jena
package with org.apache.jena
HttpSolrClient
(with a Builder
)Now the code compiles again, but tests fail because transactions are not being used (correctly):
Tests in error:
TestBOR.testAberAnno:125 » TDBTransaction Not in a transaction
TestBOR.testAnnotation:65 » TDBTransaction Not in a transaction
TestBOR.testRetrieveAnnotation:105 » TDBTransaction Not in a transaction
TestMirador2.TestMirador2:72 » TDBTransaction Not in a transaction
TestMirador2.testPopulate:87 » TDBTransaction Not in a transaction
TestMirador214.testMirador214:72 » TDBTransaction Not in a transaction
TestPublish.testCreate:96 » TDBTransaction Not in a transaction
TestPublish.testDates:180 » TDBTransaction Not in a transaction
TestPublish.testDelete:107 » TDBTransaction Not in a transaction
TestPublish.testDuplicate:165 » TDBTransaction Not in a transaction
TestPublish.testPage:135 » TDBTransaction Not in a transaction
TestPublish.testPublish:69 » TDBTransaction Not in a transaction
TestPublish.testUTF8:153 » TDBTransaction Not in a transaction
TestPublish.testUpdate:119 » TDBTransaction Not in a transaction
TestSearch.getAllAnnotations:247 » TDBTransaction Not in a transaction
TestSearch.loadManifest:114 » TDBTransaction Not in a transaction
TestSearch.testEndToEnd:269 » TDBTransaction Not in a transaction
TestSearch.testMirador:194 » TDBTransaction Not in a transaction
TestSearch.testPagination:215 » TDBTransaction Not in a transaction
TestSearch.testPassedWithin:100 » TDBTransaction Not in a transaction
TestSearch.testSearching:154 » TDBTransaction Not in a transaction
Tests run: 23, Failures: 0, Errors: 21, Skipped: 0
Thanks Ben for looking into this. I'm afraid I didn't think to test SAS when I switched iiif.io to https. Thanks also for your investigation, and that mvn command looks very useful!
I can have a look at the transactions (unless your already looking into this). I take it, its this I should be following: https://jena.apache.org/documentation/txn/transactions_api.html
Thanks.
@glenrobson I'm looking into this, but I had missed the txn documentation – I was looking at the tdb and tdb2 documentation, wondering which to use…
Some hours of staring at code, trial and error later… I'm beginning to think SAS isn't as simple as its name suggests 🤓
And looking at some constructs in the code, I think this hasn't been the first time someone ran into the issue of starting and stopping transactions unless one is already in progress. From my humble perspective transactions are managed at too many layers, which allows that they get entangled.
I pushed some work in progress to https://github.com/bencomp/SimpleAnnotationServer/tree/fix-transactions, if you're interested.
Thanks Ill take a look. The transaction stuff for Jena should only be in the JenaStore.java
...
This should be fixed in the master branch now. I agree the transaction process is messy at the moment. At the start of this project I decided to use jena
models as the package to pass around annotations but its becoming clear that this isn't a good idea. I've started some work in the bor_merged
branch to move away from RDF models to json-ld wrapped by a java class. I think its time to push the RDF model down to the Store level and to keep the jena
transactions as low as possible.
As it is at the moment you have to handle transactions to read a model that has been retrieved from the TBD dataset and as the models are passed around it means the transaction code is bubbling up higher than needed.
Thanks for all your help identifying the issues and fixing the https issue.
You're welcome and thanks for continuing the work! I can confirm it now builds from the master branch.
I think this is different from #9 and possibly related to the move of making all of iiif.io available via HTTPS by default.
When I run
mvn package
, two tests error with a JenaRiotException
:I wonder if it has to do with the redirect of
http://iiif.io/api/presentation/2/context.json
tohttps://iiif.io/api/presentation/2/context.json
. Could it?