[jdom-interest] JDOMException: Error in building from stream: sealing violation

Jon Strande jon.strande at perfectorder.com
Tue Jun 12 04:34:46 PDT 2001


Hello all,

I have the following error:
[MessageController] - 
org.jdom.JDOMException: Error in building from stream: sealing violation

I am getting this error from the following code:

Servlet Code:
        PrintWriter out = new PrintWriter(response.getOutputStream());
        try
        {  
            InputStream inputStream =request.getInputStream();
            G2BMessageController messageController = new 
G2BMessageController();
            Document outgoingDocument = messageController.handleMessage
(inputStream);
            response.setContentType("text/xml");
            XMLOutputter outputter = new XMLOutputter("\t",true);
            outputter.output(outgoingDocument, out);
            out.flush();
        }
        catch(Exception e)
        {
            out.println(e);
        }

Message Controller Code:
        try
        {
            DOMBuilder builder = new DOMBuilder(false);
            document = builder.build(incomingXMLMessageInputStream);
            if(document == null)
            {
                logWriter.log("MessageController - doc is null", logWriter.ERROR);
            }
            else
            {
		//do stuff here to handle the message
		//... left out for clarity, it never gets this far! 
            }
        }
        catch(JDOMException e)
        {
            logWriter.log("[MessageController] - " + e, logWriter.ERROR);
        }
        catch(Exception e)
        {
            logWriter.log("[MessageController]exception occured " + e, 
logWriter.ERROR);
        }
        return returnDocument;




Client Test Code:
	//Document document = new ...
	URL url = new URL("http://frisco/servlet/MyServlet");
	HttpURLConnection uconn = (HttpURLConnection)
url.openConnection();
	uconn.setRequestMethod("POST");
	uconn.setDoOutput(true);
	OutputStream output = uconn.getOutputStream();     
	XMLOutputter outputter = new XMLOutputter("\t",true);
	outputter.output(document, output);
	output.flush(); 		
	BufferedReader br = new BufferedReader(new InputStreamReader
(url.openStream()));
	String line = "";
	while((line = br.readLine())!=null)
	{
		System.out.println(line);
	}
	br.close();


I am running this on Win NT 4.0, Sp5. iPlanet 4.1 Enterprise. 

Any thoughts would be greatly appreciated!!

Thank you in advance,

Jon


-- 

Jon Strande
jstrande at poss.com
Consultant - Perfect Order
http://www.perfectorder.com
[Sun Microsystems National Systems Provider]





More information about the jdom-interest mailing list