Using Xalan in Eclipse plugin

Posted by Leslie Norman on Stack Overflow See other posts from Stack Overflow or by Leslie Norman
Published on 2011-01-14T18:49:47Z Indexed on 2011/01/14 18:53 UTC
Read the original article Hit count: 438

Filed under:
|
|

I am facing problems in 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 lib jars 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 error:

java.lang.ClassNotFoundException: org.apache.xalan.processor.TransformerFactoryImpl

But if I run same code outside eclipse plugin with same libs on classpath, it works fine.

Could Somebody give an idea if I am doing some mistake or how to reolve this issue?

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse-plugin