camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Krasser (JIRA)" <>
Subject [jira] Created: (CAMEL-803) ValidatingProcessor not thread-safe
Date Sat, 09 Aug 2008 06:28:52 GMT
ValidatingProcessor not thread-safe

                 Key: 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:

synchronized (errorHandler) {
    DOMResult result = new DOMResult();
    validator.validate(source, result);
    errorHandler.handleErrors(exchange, schema, result);

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.

View raw message