Getting TransformerException while using JAXP to create the XML

Posted on 2009-12-18
Last Modified: 2013-11-23
I am getting the below exception while creating the XML file with JAXP
TransformerException XSL-1900: (Fatal Error) An internal error condition occurred.
Please help me to resolve this.

here is my code:


			DocumentBuilderFactory factory1 = DocumentBuilderFactory.newInstance();

			DocumentBuilder builder1 = factory1.newDocumentBuilder();

			Document document1 = builder1.newDocument();

			Element rootElement1 = document1.createElement("DashbUnit");



			for(int i=0;i<counter;i++){

				Element setElement1 = document1.createElement("Param");





			TransformerFactory tFactory1 = TransformerFactory.newInstance();


			Transformer transformer1 = tFactory1.newTransformer();

			//Add indentation to output


			(OutputKeys.INDENT, "yes");


					"{}indent-amount", "2");


			DOMSource source1 = new DOMSource(document1);

			FileOutputStream output1 = new FileOutputStream(new File(fPathParVal));

			StreamResult result1 = new StreamResult(output1);

			transformer1.transform(source1, result1);

      System.out.println("file transfered");



		} catch (IOException e) {

			System.out.println("IOException " + e.getMessage());

		} catch (ParserConfigurationException e) {


			.println("ParserConfigurationException " + e.getMessage());

		} catch (TransformerConfigurationException e) {

			System.out.println("TransformerConfigurationException "+ e.getMessage());

		} catch (TransformerException e) {

			System.out.println("TransformerException " + e.getMessage());


Open in new window

Question by:ramadevimandala
    LVL 5

    Accepted Solution

    I just tried your code with some fixed values for the attributes of the Param elements. I runs without problem.
    So the question is what values are you passing in in the parNames and parVals arrays? And what is the value of dbUnitId?

    Author Comment

    I think the problem with some browser or server, the issue is not coming now , thank you for your time

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
    This video teaches viewers about errors in exception handling.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now