解析javax.xml.transform.dom失败

时间:2018-08-02 07:51:28

标签: xslt saxon osgi-bundle schematron hapi

我们正在调用HAPI REST API来验证资源。内部HAPI使用ph-schematron jar文件进行验证。

如果我们通过使用main方法在简单的Java类中调用API,则它没有问题。但是我们在osgi框架中执行了完全相同的代码,因此产生了以下错误。

3:13:00.379 DEBUG [bwEngThread:In-Memory Process Worker-8] c.p.commons.lang.ServiceLoaderUtils - Trying to load all SPI implementations of interface com.phloc.commons.hash.IHashCodeImplementationRegistrarSPI
13:13:00.380 DEBUG [bwEngThread:In-Memory Process Worker-8] c.p.commons.lang.ServiceLoaderUtils - Finished loading all SPI implementations of interface com.phloc.commons.hash.IHashCodeImplementationRegistrarSPI --> returning 0 instances
13:13:00.416 DEBUG [bwEngThread:In-Memory Process Worker-8] c.p.c.h.HashCodeImplementationRegistry - Found no hashCode implementation for class java.lang.String
13:13:00.521 WARN  [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [warn] Transformation warning (bundleresource://237.fwk27319466:25/schematron/20100414-xslt2/iso_schematron_skeleton_for_saxon.xsl: line 572: Attribute 'version' outside of element.)
13:13:00.521 WARN  [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [warn] Transformation warning (bundleresource://237.fwk27319466:25/schematron/20100414-xslt2/iso_schematron_skeleton_for_saxon.xsl: line 596: Attribute 'version' outside of element.)
13:13:00.522 WARN  [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [warn] Transformation warning (bundleresource://237.fwk27319466:25/schematron/20100414-xslt2/iso_schematron_skeleton_for_saxon.xsl: line 615: Attribute 'version' outside of element.)
13:13:01.768 ERROR [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [error] Transformation error (Syntax error in 'not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))'.)
13:13:01.769 ERROR [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [error] Transformation error (Error parsing XPath expression 'not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))'.)
13:13:01.769 ERROR [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [error] Transformation error (Required attribute 'test' is missing.)
13:13:01.769 ERROR [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [error] Transformation error (Syntax error in 'not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])'.)
13:13:01.770 ERROR [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [error] Transformation error (Syntax error in 'not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])'.)
13:13:01.771 ERROR [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.LoggingTransformErrorListener - [fatal_error] Transformation fatal error (Syntax error in 'not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])'.)
13:13:01.800 ERROR [bwEngThread:In-Memory Process Worker-8] c.p.c.x.t.XMLTransformerFactory - Failed to parse javax.xml.transform.dom.DOMSource@522e178f
javax.xml.transform.TransformerConfigurationException: Syntax error in 'not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])'.
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:1020) ~[na:1.8.0_121]
    at com.phloc.commons.xml.transform.XMLTransformerFactory.newTemplates(XMLTransformerFactory.java:265) [phloc-commons-4.3.3.jar:4.3.3]
    at com.phloc.commons.xml.transform.XMLTransformerFactory.newTemplates(XMLTransformerFactory.java:226) [phloc-commons-4.3.3.jar:4.3.3]
    at com.phloc.schematron.xslt.SchematronProviderXSLTFromSCH.<init>(SchematronProviderXSLTFromSCH.java:177) [phloc-schematron-2.7.1.jar:2.7.1]
    at com.phloc.schematron.xslt.SchematronResourceSCHCache.createSchematronXSLTProvider(SchematronResourceSCHCache.java:115) [phloc-schematron-2.7.1.jar:2.7.1]
    at com.phloc.schematron.xslt.SchematronResourceSCHCache.getSchematronXSLTProvider(SchematronResourceSCHCache.java:192) [phloc-schematron-2.7.1.jar:2.7.1]
    at com.phloc.schematron.xslt.SchematronResourceSCH.<init>(SchematronResourceSCH.java:181) [phloc-schematron-2.7.1.jar:2.7.1]
    at com.phloc.schematron.xslt.SchematronResourceSCH.<init>(SchematronResourceSCH.java:139) [phloc-schematron-2.7.1.jar:2.7.1]
    at com.phloc.schematron.xslt.SchematronResourceSCH.<init>(SchematronResourceSCH.java:49) [phloc-schematron-2.7.1.jar:2.7.1]
    at com.phloc.schematron.xslt.SchematronResourceSCH.fromClassPath(SchematronResourceSCH.java:202) [phloc-schematron-2.7.1.jar:2.7.1]
    at ca.uhn.fhir.validation.schematron.SchematronBaseValidator.getSchematronAndCache(SchematronBaseValidator.java:147) [hapi-fhir-base-3.3.0.jar:na]
    at ca.uhn.fhir.validation.schematron.SchematronBaseValidator.getSchematron(SchematronBaseValidator.java:125) [hapi-fhir-base-3.3.0.jar:na]
    at ca.uhn.fhir.validation.schematron.SchematronBaseValidator.validateResource(SchematronBaseValidator.java:70) [hapi-fhir-base-3.3.0.jar:na]
    at ca.uhn.fhir.validation.FhirValidator.validateWithResult(FhirValidator.java:231) [hapi-fhir-base-3.3.0.jar:na]

0 个答案:

没有答案