Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 93541 invoked from network); 9 Aug 2008 06:29:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Aug 2008 06:29:13 -0000 Received: (qmail 16637 invoked by uid 500); 9 Aug 2008 06:29:12 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 16611 invoked by uid 500); 9 Aug 2008 06:29:12 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 16600 invoked by uid 99); 9 Aug 2008 06:29:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Aug 2008 23:29:12 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Aug 2008 06:28:25 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A1A5B234C197 for ; Fri, 8 Aug 2008 23:28:52 -0700 (PDT) Message-ID: <256730953.1218263332646.JavaMail.jira@brutus> Date: Fri, 8 Aug 2008 23:28:52 -0700 (PDT) From: "Martin Krasser (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Created: (CAMEL-803) ValidatingProcessor not thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org ValidatingProcessor not thread-safe ----------------------------------- Key: CAMEL-803 URL: https://issues.apache.org/activemq/browse/CAMEL-803 Project: Apache Camel Issue Type: Bug Components: camel-core Affects Versions: 1.4.0 Reporter: Martin Krasser The method org.apache.camel.processor.validation.ValidatingProcessor.process() is executed concurrently but error information is stored in a shared errorHandler. Because each thread calls errorHandler.reset() it may clean errors written by another thread. The easiest way to fix this issue would be a synchronized block: {code:java|title=ValidatingProcessor.java} ... synchronized (errorHandler) { errorHandler.reset(); validator.setErrorHandler(errorHandler); DOMResult result = new DOMResult(); validator.validate(source, result); errorHandler.handleErrors(exchange, schema, result); } ... {code} The disadvantage of this solution is that is serializes threads. A locally created error handler would be preferrable ... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.