I am facing problems with using xalan in eclipse plugin.
When I try to create factory instance by:
TransformerFactory tFactory = TransformerFactory.newInstance("org.apache.xalan.processor.TransformerFactoryImpl", null);
I get error:
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
...
I have following libs in plugin classpath: xml-apis.jar, xercesImpl.jar, serializer.jar, xalan.jar
I even can't create class instance by:
c = Class.forName("org.apache.xalan.processor.TransformerFactoryImpl");
Object o = c.newInstance();
It returns ClassNotFoundException
But I can create instances of other classes from same jar and can run same code outside eclipse without problem.
Any idea?
Edit: TransformerFactory instantiating class (say "class1") is part of an external library added in the plugin classpath wheras the xalan.jar is also in plugin classpath. If I move this "class1" into plugin, it finds the provider and works fine.