My web service, living on Axis2 inside a WSO2 WSAS application server, contains the following code:
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
}
When run, the service produces this error:
[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)
...
I do have Saxon-HE-9.4.jar
in my classpath, and it is readable. It is also available to Axis2 (/foo/bar/wso2as/wso2as-4.0.0/tmp/axis2-tmp-6436419317930731973.tmp/axis67573163200472779114Saxon-HE-9.4.jar
).
According to the Javadoc for newInstance()
, the system property I'm setting should overrule all other methods of identifying which TransformerFactory
to use, so precedence is not the issue.
What could be causing this error, and what can I do to get my desired Saxon transformer factory?