Stian Soiland-Reyes created TAVERNA-971:
-------------------------------------------

             Summary: jarcache not working through OSGi
                 Key: TAVERNA-971
                 URL: https://issues.apache.org/jira/browse/TAVERNA-971
             Project: Apache Taverna
          Issue Type: Bug
          Components: Taverna Language
    Affects Versions: language 0.15.1, commandline 3.1.0
            Reporter: Stian Soiland-Reyes
            Assignee: Stian Soiland-Reyes
             Fix For: commandline 3.1.0, language 0.16.0


taverna-robundle includes a 
[jarcache.json|https://github.com/apache/incubator-taverna-language/blob/master/taverna-robundle/src/main/resources/jarcache.json]
 which specifies 
[contexts/bundle.jsonld|https://github.com/apache/incubator-taverna-language/blob/master/taverna-robundle/src/main/resources/contexts/bundle.jsonld]
 to be loaded from the taverna-robundle JAR instead of from 
https://w3id.org/bundle/context.json

This uses [JSONLD-Java's JAR 
cache|https://github.com/jsonld-ava/jsonld-java#loading-contexts-from-classpathjar]
 - in order to avoiding network access when parsing the manifest JSON-LD of the 
robundle.

This does however not work well under OSGi with the Taverna Command Line, as 
the jarcache within the jsonld-java OSGi bundle can't access /jarcache.json in 
the taverna-robundle OSGi bundle - at least not without setting 
Thread.currentThread.setContextClassLoader().

This caused running of the workflow to fail with a large stack trace at the 
point of closing the data bundle (this happen with or without -bundle)

Note that using Jena 3.1.0 and OpenJDK on Ubuntu, access to 
https://w3id.org/bundle/context.json fails with an "internal error" SSL error, 
so even with network access it can fail.

Note that in Taverna Language 0.15.1 there was also a bug that when adding the 
Apache header to the bundle.json an extra } was added - this worked with 
earlier versions of Jackson/JSONLD-Java but now after TAVERNA-970 upgrades this 
fails - thus for the Command Line 3.1.0 I propose a workaround to add a fixed 
bundle.json on its own classpath, and then set the thread context loader to its 
own classloader while running the workflow.

The fix for robundle 0.16.0 would be to set the thread class loader before 
parsing the manifest.json.

(Thus we can fix it properly for next Taverna Language, but can ship Command 
Line 3.1.0 with existing Language 0.15.1)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to