(I am not an OSGi user)

On 15/03/16 14:11, Jaroslav Pullmann wrote:

  Hello,

   while updating our OSGi-based software to Jena 3.* we experience some
tricky errors.
  The following 3 test scenarios were run on a Ubuntu Linux 12.04,
64bit, Java 1.8.0.

Test 1

java.lang.VerifyError : somekinfd of version-of-jar problem but I cant' see what

Test 2

- Removed Xerces from Jena-OSGi bundle
- Added Import-package directive for those packages in Jena-OSGi
- Apparently there is no problem with missing packages, the only
permanent error:

2016-03-15 14:21:40,382 | ERROR | qlUpdateService) |
impl                             | 120 - eu.linksmart.metadata.impl -
0.0.1.SNAPSHOT | [SparqlQueryManager(8)] The activate method has thrown
an exception
java.lang.NullPointerException
         at org.apache.jena.query.ARQ.isTrue(ARQ.java:620)

Test 3

- Using Karaf 4.0.4
- It seems o.k. with this version to remove Xerces 2.11 from
"$Karaf/lib/endorsed"
- Same error, ARQ does not seem to be configured correctly:

[SparqlQueryManager(4)] The activate method has thrown an exception
java.lang.NullPointerException
     at org.apache.jena.query.ARQ.isTrue(ARQ.java:620)
...

The error in tests 2 and 3 looks like it is because Jena initialization has not happened.

http://jena.apache.org/documentation/notes/system-initialization.html


The default is to use ServiceLoader which looks for META-INF/services/ org.apache.jena.system.JenaSubsystemLifecycle

If your setup is a single jar then the contents of this from all modules needs to be combined:

For example, Fuseki, which is a combined jar, has:

org.apache.jena.tdb.sys.InitTDB
org.apache.jena.riot.system.InitRIOT
org.apache.jena.sparql.system.InitARQ
org.apache.jena.system.InitJenaCore
org.apache.jena.query.text.InitJenaText
org.apache.jena.query.spatial.InitJenaSpatial

It's done in the POM during shading with:

<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />

Is an equivalent for OSGi?

Or you can inject a different procedure with JenaSystem.setSubsystemRegistry

        Andy

Reply via email to