You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2018/05/04 09:07:00 UTC

[jira] [Resolved] (JENA-341) Jena breaks with Xerces 2.11.0 (XML Schema 1.1 branch)

     [ https://issues.apache.org/jira/browse/JENA-341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne resolved JENA-341.
--------------------------------
       Resolution: Fixed
         Assignee: Andy Seaborne
    Fix Version/s: Jena 3.8.0

Apaxche Xerces is no longer a dependency requirement for Apache Jena.  JENA-1537 extracts the Xerces validation code for Jena's use and removes the dependency on Xerces.

Any XML parser can be used with Jena (defaulting to the JDK-provided one) through the usual mechanism for adding to the application.

> Jena breaks with Xerces 2.11.0 (XML Schema 1.1 branch)
> ------------------------------------------------------
>
>                 Key: JENA-341
>                 URL: https://issues.apache.org/jira/browse/JENA-341
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>            Reporter: Radu Coravu
>            Assignee: Andy Seaborne
>            Priority: Major
>             Fix For: Jena 3.8.0
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> Running Jena with a Xerces 2.11.0 build which is XML Schema 1.1 aware (the xerces-java-xml-schema-1.1-dev branch) breaks with a NPE:
> ERROR [my.package.MyClass:105] An exception occured during data loading
> java.lang.NullPointerException
> at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(Unknown Source)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(Unknown Source)
> 	at com.hp.hpl.jena.datatypes.xsd.XSDDatatype.parse(XSDDatatype.java:272)
> 	at com.hp.hpl.jena.graph.impl.LiteralLabelImpl.setValue(LiteralLabelImpl.java:213)
> 	at com.hp.hpl.jena.graph.impl.LiteralLabelImpl.setLiteralLabel_1(LiteralLabelImpl.java:107)
> 	at com.hp.hpl.jena.graph.impl.LiteralLabelImpl.<init>(LiteralLabelImpl.java:96)
> 	at com.hp.hpl.jena.graph.impl.LiteralLabelFactory.createLiteralLabel(LiteralLabelFactory.java:28)
> 	at com.hp.hpl.jena.graph.Node.createLiteral(Node.java:101)
> 	at com.hp.hpl.jena.rdf.arp.JenaReader.convert(JenaReader.java:120)
> 	at com.hp.hpl.jena.rdf.arp.JenaReader.convert(JenaReader.java:143)
> 	at com.hp.hpl.jena.rdf.arp.JenaHandler.statement(JenaHandler.java:89)
> 	at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.triple(XMLHandler.java:86)
> 	at com.hp.hpl.jena.rdf.arp.impl.ParserSupport.triple(ParserSupport.java:228)
> 	at com.hp.hpl.jena.rdf.arp.states.WantDescription.aPredAndObj(WantDescription.java:116)
> 	at com.hp.hpl.jena.rdf.arp.states.WantPropertyElement.theObject(WantPropertyElement.java:213)
> 	at com.hp.hpl.jena.rdf.arp.states.WantTypedLiteral.endElement(WantTypedLiteral.java:50)
> 	at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.endElement(XMLHandler.java:133)
> 	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLNamespaceBinder.endElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(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:155)
> 	at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:173)
> 	at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:160)
> 	at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:232)
> 	at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:235)
> 	at my.package.MyClass.load(MyClass.java:97)
> The org.apache.xerces.impl.validation.ValidationState you are passing to the Xerces XSSimpleTypeDecl has a NULL TypeValidatorHelper and the Xerces build which is XML Schema 1.1 aware looks a lot in the TypeValidatorHelper to see if it is running in XML Schema 1.1 compatibility mode like:
>  final String options = context.getTypeValidatorHelper().isXMLSchema11() ? "Xbh" : "X";
> The class org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl is an internal Xerces class. Maybe you should try breaking dependencies to internal classes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)