java.lang.IllegalAccessError in org.mindswap.pellet.jena.PelletInfGraph

617 views
Skip to first unread message

John Keeney

unread,
Aug 6, 2013, 7:37:59 AM8/6/13
to pellet...@googlegroups.com


Hi all,

Please see error at end of mail. Class: org.mindswap.pellet.jena.PelletInfGraph

It seems the field com.hp.hpl.jena.reasoner.BaseInfGraph.isPrepared has been made "private" in recent versions of Jena
(I use Jena 2.10.1 with Pellet 2.3.1)

Suggest replacing read accesses to field with "super.isPrepared()"
Suggest replacing write accesses to the field with "super.setPreparedState(boolean state)"

org/mindswap/pellet/jena/PelletInfGraph.java
Line 178
Line 254
Line 264
Line 268
Line 534
Line 549


Exception in thread "main" java.lang.IllegalAccessError: tried to access field com.hp.hpl.jena.reasoner.BaseInfGraph.isPrepared from class org.mindswap.pellet.jena.PelletInfGraph
    at org.mindswap.pellet.jena.PelletInfGraph.performAdd(PelletInfGraph.java:534)
    at com.hp.hpl.jena.graph.impl.GraphBase.add(GraphBase.java:202)
    at org.apache.jena.riot.system.StreamRDFLib$ParserOutputGraph.triple(StreamRDFLib.java:150)
    at org.apache.jena.riot.lang.LangRDFXML$HandlerSink.statement(LangRDFXML.java:170)
    at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.triple(XMLHandler.java:82)
    at com.hp.hpl.jena.rdf.arp.impl.ParserSupport.triple(ParserSupport.java:225)
    at com.hp.hpl.jena.rdf.arp.states.WantDescription.startElement(WantDescription.java:99)
    at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.startElement(XMLHandler.java:121)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:151)
    at com.hp.hpl.jena.rdf.arp.ARP.load(ARP.java:119)
    at org.apache.jena.riot.lang.LangRDFXML.parse(LangRDFXML.java:142)
    at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTFactoryImpl$1.read(RDFParserRegistry.java:142)
    at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:760)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:258)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:244)
    at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:69)
    at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274)
    at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2248)

j

unread,
Sep 11, 2013, 10:28:29 AM9/11/13
to pellet...@googlegroups.com
Hi,

using Jena 2.10.0 may be an option in the meantime.

best regards

Matías Parodi

unread,
Oct 27, 2013, 8:05:06 PM10/27/13
to pellet...@googlegroups.com
Hello,

Is there any plan to fix it? I'm having the same problem and using Jena 2.10.0 is not an option (Fuseki 1.0 uses Jena 2.11, I can't downgrade because I need text-query support, only available in this version of Fuseki as far as I know).

Thanks,
Matt

Maatary Okouya

unread,
Dec 11, 2013, 4:02:47 PM12/11/13
to pellet...@googlegroups.com
Hi have the same issue, with the last version of jena: 2.11. 

Actually i am only interested in using Jena sparql query capability. Otherwise i'm working on the OWL-API. More specifically i'm following the following example for the pellet page: 

>>>>

There is no native SPARQL support in OWLAPI. However, a Jena model can be created with the contents of an OWLAPI reasoner so SPARQL query answering can be done on the Jena model.OWLAPI reasoner and Jena model can be queried together but all updates should be done on theOWLAPI ontology. The following snippet shows the general idea behind this approach:

   // import com.clarkparsia.pellet.owlapiv3.PelletReasoner;
   // import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory;

   // Create OWLAPI ontology as usual
   OWLOntology ontology = ...
   // Create Pellet-OWLAPI reasoner (non-buffering mode makes synchronization easier)
   PelletReasoner reasoner = 
         PelletReasonerFactory.getInstance().createNonBufferingReasoner( ontology );
   // Get the KB from the reasoner
   KnowledgeBase kb = reasoner.getKB();
   // Create a Pellet graph using the KB from OWLAPI
   PelletInfGraph graph = new org.mindswap.pellet.jena.PelletReasoner().bind( kb );
   // Wrap the graph in a model
   InfModel model = ModelFactory.createInfModel( graph );
   // Use the model to answer SPARQL queries

The model created this way cannot be used to answer SPARQL queries that query for RDF syntax triples, e.g. SELECT * WHERE { ?x owl:onProperty ?p }.

>>>>>

Is there any other solution to that than downgrading ? 


Many thanks

John Keeney

unread,
Jan 22, 2015, 12:22:10 PM1/22/15
to pellet...@googlegroups.com
Hi all
This appears to be fixed in the GitHub version of the code.
See https://issues.apache.org/jira/browse/JENA-858
and https://github.com/clarkparsia/pellet

Pellet version 2.3.2-SNAPSHOT should be OK.
Reply all
Reply to author
Forward
0 new messages