<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>org.jdom.IllegalAddException: The attribute already has an existing parent "transaction"</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Verdana">We have an application that was using JDOM Beta4/Beta5 version. Now, we have moved on to JDOM Beta8/Beta9 version. How do I know what JDOM version is installed on my machine by just looking at the JAR files ? What do I need to do fix this exception ?</FONT></P>
<P><FONT SIZE=2 FACE="Verdana">=========================================</FONT>
<BR><FONT SIZE=2 FACE="Verdana">I am seeing the following exception:</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">**********Error Trace::Version 10.5.0.0.012604::Mon Feb 23 15:53:59 2004 ( 20:53</FONT>
<BR><FONT SIZE=2 FACE="Verdana">:59.155 GMT t@616 )</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> #0 Error #1600039 XML sent from servlet read.</FONT>
<BR><FONT SIZE=2 FACE="Verdana">org.jdom.IllegalAddException: The attribute already has an existing parent "transaction"</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">**********</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">=========================================</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">Here is the code-snippet where the exception is being thrown:</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana"> try</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> {</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> // get the settings required to load the xml dropped by servlet</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> IntegrationGlobalConfigObject gco = new IntegrationGlobalConfigObject();</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> getAttribute(context, gco, IntegrationGlobalConfigObject.IN_RIP_MODE);</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> getAttribute(context, gco, IntegrationGlobalConfigObject.LOCAL_PROJECT_FILEPATH);</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana"> codeRegn = "GCO read.";</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana"> // load the xml</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> Element elCommandRoot = loadXMLSentFromServlet(gco, args[0], context);</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana"> codeRegn = "XML sent from servlet read.";</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana"> // prepare preliminary response header</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> // create the response placeholder</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> Element elResponseRoot = new Element("transaction");</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> // copy/modify attributes from request</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> System.out.println("1");</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> elResponseRoot.setAttributes(elCommandRoot.getAttributes());</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> System.out.println("2");</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> elResponseRoot.getAttribute("type").setValue("response");</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> System.out.println("3");</FONT>
<BR><FONT SIZE=2 FACE="Verdana"> .....</FONT>
</P>
</BODY>
</HTML>