【发布时间】:2013-04-22 05:27:04
【问题描述】:
我的 Web 服务位于 WSO2 WSAS 应用服务器内的 Axis2 上,包含以下代码:
String prop = "javax.xml.transform.TransformerFactory";
String val = "net.sf.saxon.TransformerFactoryImpl";
public static TransformerFactory getTransformerFactory() {
System.setProperty(prop, val); // This line executes normally
return TransformerFactory.newInstance(); // Error occurs inside this call
}
运行时,服务会产生以下错误:
[2013-04-15 12:22:41,263] ERROR
{org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught
exception
javax.xml.transform.TransformerFactoryConfigurationError: Provider
net.sf.saxon.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at com.example.Setup.getTransformerFactory(Setup.java:40)
at com.example.ProcessFiles.init(ProcessFiles.java:336)
at com.example.TorgApp.incoming(TorgApp.java:229)
...
我的类路径中有Saxon-HE-9.4.jar,它是可读的。它也适用于 Axis2 (/foo/bar/wso2as/wso2as-4.0.0/tmp/axis2-tmp-6436419317930731973.tmp/axis67573163200472779114Saxon-HE-9.4.jar)。
根据the Javadoc for newInstance(),我设置的系统属性应该覆盖所有其他识别使用哪个TransformerFactory 的方法,因此优先级不是问题。
什么可能导致这个错误,我可以做些什么来获得我想要的撒克逊变压器工厂?
【问题讨论】:
标签: java wso2 saxon transformer wso2wsas