My Oracle Support Banner

java.lang.ClassCastException When Getting a javax.xml.transform.TransformerFactory Instance (Doc ID 225814.1)

Last updated on OCTOBER 31, 2019

Applies to:

Oracle XML Developers Kit - Version and later
Information in this document applies to any platform.
***Checked for relevance on 12-Apr-2013***


Consider the following JAXP code

import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import org.w3c.dom.Node;

public class TestTransform {
public static void main(String[] args)

System.setProperty("javax.xml.transform.TransformerFactory", "oracle.xml.jaxp.JXTransformer");
try {
TransformerFactory tfactory = TransformerFactory.newInstance();
Transformer serializer = tfactory.newTransformer();
catch (Exception e) {

When executing this code, the following error occurs:

> javac
> java TestTransform

Exception in thread "main" javax.xml.transform.TransformerFactoryConfigurationError: Provider oracle.xml.jaxp.JXTransformer not found
at javax.xml.transform.TransformerFactory.newInstance(
at TestTransform.main(


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.