Thread: XML & Apache

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    1
    Rep Power
    0
    Hi All..
    Can anybody tell me why the following code is returning a ClassCastException when I try to get a reference to a
    TransformerFactory factory object? All jar files are setup file with xalan.jar being used on a Solaris system with jdk1.2

    Thanks
    Kevin


    TransformerFactory tFactory;
    try
    {
    tFactory = TransformerFactory.newInstance();
    }
    catch(java.lang.ClassCastException e)
    {
    e.printStackTrace();
    }
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    1
    Rep Power
    0

    not a java expert


    But... shouldn't it be
    TransformerFactory tFactory = new TransformerFactory.newInstance();

    It seems weird that your constructor is a method called 'newInstance()'. But, like I said, I'm no expert.

    Good luck.
    Last edited by jwinter1; April 17th, 2001 at 08:39 PM.

IMN logo majestic logo threadwatch logo seochat tools logo