You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Ivan S. Dubrov (JIRA)" <ji...@apache.org> on 2009/02/27 07:32:00 UTC

[jira] Created: (CAMEL-1401) JaxbDataFormat is not thread-safe

JaxbDataFormat is not thread-safe
---------------------------------

                 Key: CAMEL-1401
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1401
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-jaxb
    Affects Versions: 1.6.0, 1.5.0
            Reporter: Ivan S. Dubrov
            Priority: Critical


JaxbDataFormat reuses the Marshaller/Unmarshaller instances.

However, according to the https://jaxb.dev.java.net/faq/index.html#threadSafety, Marshaller/Unmarshaller instances are NOT thread safe, so you can't use them from separate threads at the same time.

Due to this we are getting exceptions from the JAXB implementation (like ClassCastException or "org.xml.sax.SAXException: FWK005 parse may not be called while parsing."). Everything works nice with our custom JaxbDataFormat that creates new Unmarshaller/Marshaller instance on every request.

Also, lazy-creating instances (like JAXBContext) in getter methods is not thread-safe as well (because explicit synchronization is required).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1401) JaxbDataFormat is not thread-safe

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1401:
-------------------------------

    Fix Version/s: 1.6.1
                   2.0.0
         Assignee: Claus Ibsen

Thanks for reporting this. I will get it fixed asap.

> JaxbDataFormat is not thread-safe
> ---------------------------------
>
>                 Key: CAMEL-1401
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1401
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-jaxb
>    Affects Versions: 1.5.0, 1.6.0
>            Reporter: Ivan S. Dubrov
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 2.0.0, 1.6.1
>
>
> JaxbDataFormat reuses the Marshaller/Unmarshaller instances.
> However, according to the https://jaxb.dev.java.net/faq/index.html#threadSafety, Marshaller/Unmarshaller instances are NOT thread safe, so you can't use them from separate threads at the same time.
> Due to this we are getting exceptions from the JAXB implementation (like ClassCastException or "org.xml.sax.SAXException: FWK005 parse may not be called while parsing."). Everything works nice with our custom JaxbDataFormat that creates new Unmarshaller/Marshaller instance on every request.
> Also, lazy-creating instances (like JAXBContext) in getter methods is not thread-safe as well (because explicit synchronization is required).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-1401) JaxbDataFormat is not thread-safe

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1401.
--------------------------------

    Resolution: Fixed

Trunk: Committed revision 748436.
1.x: Committed revision 748450.

> JaxbDataFormat is not thread-safe
> ---------------------------------
>
>                 Key: CAMEL-1401
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1401
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-jaxb
>    Affects Versions: 1.5.0, 1.6.0
>            Reporter: Ivan S. Dubrov
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 2.0.0, 1.6.1
>
>
> JaxbDataFormat reuses the Marshaller/Unmarshaller instances.
> However, according to the https://jaxb.dev.java.net/faq/index.html#threadSafety, Marshaller/Unmarshaller instances are NOT thread safe, so you can't use them from separate threads at the same time.
> Due to this we are getting exceptions from the JAXB implementation (like ClassCastException or "org.xml.sax.SAXException: FWK005 parse may not be called while parsing."). Everything works nice with our custom JaxbDataFormat that creates new Unmarshaller/Marshaller instance on every request.
> Also, lazy-creating instances (like JAXBContext) in getter methods is not thread-safe as well (because explicit synchronization is required).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.