我是OSGi的新手,正在使用Eclipse处理某些Java应用程序,并且需要使用XSLT处理器。我需要使用Saxon处理器。我在OSGi捆绑包类路径和MANIFEST.MF中包含了它的依赖关系,如下所示:
但是我遇到以下错误:
c.p.s.x.SchematronProviderXSLTFromSCH - Schematron preprocessor error
java.lang.ExceptionInInitializerError: null
at com.phloc.schematron.xslt.SchematronProviderXSLTFromSCH.<init>(SchematronProviderXSLTFromSCH.java:121) ~[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:209) [hapi-fhir-base-3.3.0.jar:na]
at com.project.bw.palette.fhir.runtime.validator.helper.ResourceValidatorHelper.performValidation(ResourceValidatorHelper.java:175) [com.project.bw.palette.fhir.runtime/:na]
at com.project.bw.palette.fhir.runtime.validator.helper.ResourceValidatorHelper.resourceValidation(ResourceValidatorHelper.java:110) [com.project.bw.palette.fhir.runtime/:na]
at com.project.bw.palette.fhir.runtime.validator.FhirValidatorActivity.execute(FhirValidatorActivity.java:59) [com.project.bw.palette.fhir.runtime/:na]
at com.project.bw.core.runtime.bx.BWBxActivityBridgeImpl.doEval(BWBxActivityBridgeImpl.java:833) [com.project.bw.core.runtime_6.3.802.001.jar:na]
at com.project.bw.core.runtime.bx.BWBxActivityBridgeImpl.eval(BWBxActivityBridgeImpl.java:695) [com.project.bw.core.runtime_6.3.802.001.jar:na]
at com.project.bx.core.behaviors.activity.BxExtensionBehavior.doEval(BxExtensionBehavior.java:162) [com.project.bx.core_2.1.206.004.jar:na]
at com.project.bx.core.behaviors.activity.BxActivityBaseBehavior.eval(BxActivityBaseBehavior.java:817) [com.project.bx.core_2.1.206.004.jar:na]
at com.project.bx.core.behaviors.activity.BxActivityBaseBehavior.eval(BxActivityBaseBehavior.java:1) [com.project.bx.core_2.1.206.004.jar:na]
at com.project.pvm.infra.api.impl.util.director.IpmEventDirectorBase.handleModelEvent(IpmEventDirectorBase.java:195) [com.project.pvm.core.infra_4.1.202.001.jar:na]
at com.project.pvm.infra.api.impl.util.director.IpmEventDirectorBase.handleEvent(IpmEventDirectorBase.java:111) [com.project.pvm.core.infra_4.1.202.001.jar:na]
at com.project.pvm.infra.support.work.impl.WorkItemAbstract.execute(WorkItemAbstract.java:177) [com.project.pvm.core.infra_4.1.202.001.jar:na]
at com.project.pvm.im.rt.xm.util.work.ImxSTWorkRunnable.doWorkBlock(ImxSTWorkRunnable.java:170) [com.project.pvm.im.rt.xm_4.1.200.004.jar:na]
at com.project.pvm.infra.services.engine.impl.STWorkRunnable.run(STWorkRunnable.java:50) [com.project.pvm.core.infra_4.1.202.001.jar:na]
at com.project.pvm.im.rt.xm.util.work.ImxSTWorkRunnable.run(ImxSTWorkRunnable.java:62) [com.project.pvm.im.rt.xm_4.1.200.004.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_121]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_121]
Caused by: com.phloc.commons.exceptions.InitializationException: Failed to create XML TransformerFactory
at com.phloc.commons.xml.transform.XMLTransformerFactory.createTransformerFactory(XMLTransformerFactory.java:80) ~[phloc-commons-4.3.3.jar:4.3.3]
at com.phloc.commons.xml.transform.XMLTransformerFactory.<clinit>(XMLTransformerFactory.java:54) ~[phloc-commons-4.3.3.jar:4.3.3]
... 28 common frames omitted
Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider net.sf.saxon.TransformerFactoryImpl not found
at javax.xml.transform.FactoryFinder.newInstance(Unknown Source) ~[na:1.8.0_121]
at javax.xml.transform.FactoryFinder.find(Unknown Source) ~[na:1.8.0_121]
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source) ~[na:1.8.0_121]
at com.phloc.commons.xml.transform.XMLTransformerFactory.createTransformerFactory(XMLTransformerFactory.java:71) ~[phloc-commons-4.3.3.jar:4.3.3]
... 29 common frames omitted
Caused by: java.lang.ClassNotFoundException: net/sf/saxon/TransformerFactoryImpl
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_121]
at java.lang.Class.forName(Unknown Source) ~[na:1.8.0_121]
at javax.xml.transform.FactoryFinder.getProviderClass(Unknown Source) ~[na:1.8.0_121]
... 33 common frames omitted
有人可以在这里帮助我吗?
关于, 阿密特。
答案 0 :(得分:0)
您可能将变压器工厂初始化为:
TransformerFactory fact = TransformerFactory.newInstance();
使用与OSGi不兼容的服务加载机制。
尝试使用:
TransformerFactory fact = new net.sf.saxon.TransformerFactoryImpl();