Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-566

Strange behaviour of Jena in OSGi Blueprint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • ARQ
    • OSGi blueprint ARQ 2.11.1-SNAPSHOT

    Description

      Everytime I do a:
      model.read(input, null);
      I get:

      com.hp.hpl.jena.shared.ConfigException: Reader not found on classpath
      at com.hp.hpl.jena.rdf.model.impl.RDFReaderFImpl.getReader(RDFReaderFImpl.java:108)
      ClassNotFoundException: org.apache.jena.riot.adapters.JenaReadersWriters$RDFReaderRIOT_RDFXML

      I'm working in an OSGi blueprint environment. When I test this in a normal environment, everything works ok.

      My source code is:

      final String modelText = "\n"
      + "<rdf:RDF \n"
      + " xmlns:res=\"http://www.w3.org/2005/sparql-results#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"> \n"
      + " <rdf:Description rdf:about=\"http://www.w3.org/2005/sparql-results#ResultSet\">\n"
      + " <res:solution rdf:nodeID=\"r0\"/>\n"
      + " <res:solution rdf:nodeID=\"r1\"/>\n"
      + " <res:solution rdf:nodeID=\"r2\"/>\n"
      + " </rdf:Description>\n" + "</rdf:RDF>";
      final Model model = ModelFactory.createDefaultModel();
      model.read(new ByteArrayInputStream(modelText.getBytes()), null);
      model.close();

      I also add this in my pom, but it seems to do nothing:

      <!-- jena bundle can run stand along without ARQ. However if
      ARQ is present then it can call RDFReaderF to specify that various RIOT
      readers should be used instead of the ones in the jena bundle. The jena bundle
      therefore needs access to the RIOT classes. So define an optional dependency
      from the jena bundle to the arq bundle. This allows RDFReaderF to load the
      RIOT parser classes. -->
      <Require-Bundle>
      wrap_mvn_org.apache.jena_jena-arq_2.11.1-SNAPSHOT;resolution:=optional
      </Require-Bundle>

      Attachments

        Activity

          People

            andy Andy Seaborne
            izmendi Izaskun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5h
                5h
                Remaining:
                Remaining Estimate - 5h
                5h
                Logged:
                Time Spent - Not Specified
                Not Specified