Hi! I'm trying to use OpenSesame on android. Therefore i included the opensesame-onejar in my project.
When running the project, a exception is thrown: java.lang.NoClassDefFoundError: javax.imageio.spi.ServiceRegistry thrown in the info.aduna.lang.service.ServiceRegistry.(ServiceRegistry.java:37).
In my Code it appears, when I want to add a rdf-file: con.add(file, baseURI, RDFFormat.NTRIPLES);
I'm creating my repository as follows: Repository myRepository = new SailRepository(new MemoryStore()); myRepository.initialize(); RepositoryConnection con = myRepository.getConnection();
Can you explain how I should rewrite the ServiceRegistry?
asked 25 May '12, 04:17
Sesame-2.7.0 updates to using Java-6, including switching to using java.util.ServiceLoader, so you shouldn't get the class not found error for that class. However, there may be other classes that are not supported by Android's Dalvik virtual machine, which isn't a full Java Virtual Machine implementation.
If you want to avoid using the service registry you can also hardcode references to your desired parsers and parse the triples directly into the RepositoryConnection using the RDFInserter implementation as your RDFHandler that is attached to your RDFParser.
answered 02 May, 21:41
Sesame's ServiceRegistry uses the
I'm not immediately sure if there is an easy way to fix this. There may be a way to download and install the necessary packages separately, but someone with more experience developing for Android should be better placed to tell you that.
You could presumably work around the problem by actually creating the parser object manually instead of relying on Sesame to figure it out for you, but that would be a bit unwieldy.
I've also noticed that there may be an easy way to fix this in Sesame itself, by replacing the use of
answered 25 May '12, 20:14
Jeen Broekstra ♦