<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: FW: [jdom-interest] Sealing violation</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Are these for JAXP?</FONT>
</P>
<P><FONT SIZE=2>import javax.xml.parsers.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.transform.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.transform.stream.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.transform.dom.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.parsers.DocumentBuilder;</FONT>
<BR><FONT SIZE=2>import javax.xml.parsers.DocumentBuilderFactory;</FONT>
<BR><FONT SIZE=2>import javax.xml.parsers.ParserConfigurationException;</FONT>
</P>
<P><FONT SIZE=2>I don't think you need JAXP and JDOM both. It's still a classpath issue of some sort. Try moving the JDOM jar up in the CLASSPATH as well, and removing JAXP altogether (including the imports).</FONT></P>
<BR>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: JStalnecker@idssinfo.com [<A HREF="mailto:JStalnecker@idssinfo.com">mailto:JStalnecker@idssinfo.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, March 08, 2001 1:59 PM</FONT>
<BR><FONT SIZE=2>To: Steven Smith</FONT>
<BR><FONT SIZE=2>Cc: jdom-interest@jdom.org; jdom-interest-admin@jdom.org</FONT>
<BR><FONT SIZE=2>Subject: Re: FW: [jdom-interest] Sealing violation</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>My JDomServlet2 is not part of a package, however I have written another</FONT>
<BR><FONT SIZE=2>servlet trying to the same thing in a different way. I have included the</FONT>
<BR><FONT SIZE=2>source below, it uses the same CustomerInfo.class.</FONT>
</P>
<P><FONT SIZE=2>import java.io.*;</FONT>
<BR><FONT SIZE=2>import javax.servlet.*;</FONT>
<BR><FONT SIZE=2>import javax.servlet.http.*;</FONT>
<BR><FONT SIZE=2>import org.apache.xalan.*;</FONT>
<BR><FONT SIZE=2>import org.jdom.*;</FONT>
<BR><FONT SIZE=2>import org.jdom.input.*;</FONT>
<BR><FONT SIZE=2>import org.jdom.output.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.parsers.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.transform.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.transform.stream.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.transform.dom.*;</FONT>
<BR><FONT SIZE=2>import javax.xml.parsers.DocumentBuilder;</FONT>
<BR><FONT SIZE=2>import javax.xml.parsers.DocumentBuilderFactory;</FONT>
<BR><FONT SIZE=2>import javax.xml.parsers.ParserConfigurationException;</FONT>
</P>
<BR>
<P><FONT SIZE=2>public class JDomServlet extends HttpServlet {</FONT>
</P>
<P><FONT SIZE=2> ServletContext context = null;</FONT>
</P>
<P><FONT SIZE=2> // initialize the Servlet. This code is executed once.</FONT>
<BR><FONT SIZE=2> public void init(ServletConfig config) throws ServletException {</FONT>
<BR><FONT SIZE=2> super.init(config);</FONT>
</P>
<P><FONT SIZE=2> context = config.getServletContext();</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2> // handle a single request from the client</FONT>
<BR><FONT SIZE=2> public void doGet(HttpServletRequest request,</FONT>
<BR><FONT SIZE=2> HttpServletResponse response) throws IOException,</FONT>
<BR><FONT SIZE=2> ServletException {</FONT>
</P>
<P><FONT SIZE=2> try</FONT>
<BR><FONT SIZE=2> {</FONT>
</P>
<P><FONT SIZE=2> HttpSession session = request.getSession(true);</FONT>
<BR><FONT SIZE=2> String xslURL = request.getParameter("xslURL");</FONT>
<BR><FONT SIZE=2> System.out.println("inside servlet");</FONT>
<BR><FONT SIZE=2> response.setContentType("text/html");</FONT>
</P>
<P><FONT SIZE=2> // in a real app, the CreditInfo object would be retrieved</FONT>
<BR><FONT SIZE=2> // from an EJB component</FONT>
<BR><FONT SIZE=2> CustomerInfo ci = new CustomerInfo("100014", "123 Main</FONT>
<BR><FONT SIZE=2>Street", "Suite 12345",</FONT>
<BR><FONT SIZE=2> "This is the third address line", "Reading", "PA",</FONT>
<BR><FONT SIZE=2>"19607");</FONT>
</P>
<P><FONT SIZE=2> // convert the JDOM into DOM</FONT>
<BR><FONT SIZE=2> Document jdomDoc = ci.getDocument();</FONT>
</P>
<P><FONT SIZE=2> org.w3c.dom.Document domDoc =</FONT>
<BR><FONT SIZE=2> new DOMOutputter().output(jdomDoc);</FONT>
</P>
<P><FONT SIZE=2> TransformerFactory tFactory = TransformerFactory.newInstance</FONT>
<BR><FONT SIZE=2>();</FONT>
</P>
<P><FONT SIZE=2> if (tFactory.getFeature(DOMSource.FEATURE) &&</FONT>
<BR><FONT SIZE=2>tFactory.getFeature(StreamResult.FEATURE))</FONT>
<BR><FONT SIZE=2> {</FONT>
</P>
<BR>
<P><FONT SIZE=2> // Use the TransformerFactory to instantiate a Transformer that will</FONT>
<BR><FONT SIZE=2>work with</FONT>
<BR><FONT SIZE=2> // the stylesheet you specify. This method call also processes the</FONT>
<BR><FONT SIZE=2>stylesheet</FONT>
<BR><FONT SIZE=2> // into a compiled Templates object.</FONT>
<BR><FONT SIZE=2> Transformer transformer = tFactory.newTransformer(new</FONT>
<BR><FONT SIZE=2>StreamSource(xslURL));</FONT>
</P>
<P><FONT SIZE=2> // Use the Transformer to apply the associated Templates object to an</FONT>
<BR><FONT SIZE=2>XML document</FONT>
<BR><FONT SIZE=2> // (foo.xml) and write the output to a file (foo.out).</FONT>
<BR><FONT SIZE=2> transformer.transform(new DOMSource(domDoc), new</FONT>
<BR><FONT SIZE=2>StreamResult(response.getWriter()));</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> } catch (Exception ex) {</FONT>
<BR><FONT SIZE=2> ex.printStackTrace();</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>}</FONT>
</P>
<P><FONT SIZE=2>The funny thing is that this servlet also produces a sealing violation,</FONT>
<BR><FONT SIZE=2>however it manifests itself differently. I have highlighted the statement</FONT>
<BR><FONT SIZE=2>that produces the error. When JDomServlet is run, the before mentioned</FONT>
<BR><FONT SIZE=2>error appears in the browser window. When JDomServlet is run (I am running</FONT>
<BR><FONT SIZE=2>both servlets on Resin1.1), the below error is produced in the DOS prompt</FONT>
<BR><FONT SIZE=2>associated with Resin.</FONT>
</P>
<P><FONT SIZE=2> org.jdom.JDOMException: Exception outputting Document: sealing violation</FONT>
<BR><FONT SIZE=2> at org.jdom.output.DOMOutputter.output<DOMOutputter.java, compiled</FONT>
<BR><FONT SIZE=2>code></FONT>
<BR><FONT SIZE=2> at JDomServlet.doGet<JDomServlet.java:50></FONT>
<BR><FONT SIZE=2> etc..</FONT>
<BR><FONT SIZE=2>Root cause: java.lang.SecurityException: sealing violation</FONT>
<BR><FONT SIZE=2>etc...</FONT>
</P>
<BR>
<P><FONT SIZE=2>Thanks again for all your help,</FONT>
<BR><FONT SIZE=2>Joy</FONT>
</P>
<BR>
</BODY>
</HTML>