Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 82923 invoked from network); 5 Mar 2002 13:07:40 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 5 Mar 2002 13:07:40 -0000 Received: (qmail 19933 invoked by uid 97); 5 Mar 2002 13:07:38 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 19917 invoked by uid 97); 5 Mar 2002 13:07:38 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 19896 invoked by uid 50); 5 Mar 2002 13:07:37 -0000 Date: 5 Mar 2002 13:07:37 -0000 Message-ID: <20020305130737.19895.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: avalon-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 6877] New: - Reusing JaxpParser causes problems X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6877 Reusing JaxpParser causes problems Summary: Reusing JaxpParser causes problems Product: Avalon Version: unspecified Platform: All OS/Version: All Status: NEW Severity: Critical Priority: Other Component: Excalibur AssignedTo: avalon-dev@jakarta.apache.org ReportedBy: dims@yahoo.com Xerces does not clear the LexicalHandler for resuing this parser instance the next time around. We need to clean it up ourselves. Here's a patch. Thanks, dims Index: src/java/org/apache/avalon/excalibur/xml/JaxpParser.java =================================================================== RCS file: /home/cvspublic/jakarta-avalon- excalibur/src/java/org/apache/avalon/excalibur/xml/JaxpParser.java,v retrieving revision 1.1 diff -d -u -b -B -w -u -r1.1 JaxpParser.java --- src/java/org/apache/avalon/excalibur/xml/JaxpParser.java 15 Feb 2002 10:57:39 -0000 1.1 +++ src/java/org/apache/avalon/excalibur/xml/JaxpParser.java 5 Mar 2002 13:02:56 -0000 @@ -251,6 +251,7 @@ { this.getLogger().warn("SAX2 driver does not support property: "+ "'http://xml.org/sax/properties/lexical- handler'"); + lexicalHandler = null; } tmpReader.setErrorHandler( this ); @@ -264,8 +265,14 @@ tmpReader.parse(in); // Here, parsing was successful : restore this.reader - if ( this.reuseParsers ) + if ( this.reuseParsers ) { this.reader = tmpReader; + // Reset the Lexical Handler to null, so that we can reuse the parser + if(lexicalHandler != null) { + tmpReader.setProperty("http://xml.org/sax/properties/lexical- handler", + null); + } + } } /** -- To unsubscribe, e-mail: For additional commands, e-mail: