[
https://issues.apache.org/jira/browse/CAMEL-10282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paolo Antinori updated CAMEL-10282:
-----------------------------------
Description:
Avro holds a cache of classloaders and other reflection related classes in a
static map here:
https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java#L52-L57
Keys of that map are {{String}}s with classname.
The cache is never updated, and this breaks OSGi ability to update a new class
definition, since avro *will keep pointing to the old version*.
This will lead to a situation where, on an OSGi platform, you are exposed to
{{ClassCastException}} since the rest of the platform might see a different
varsion than the old one cached by avro.
The attached fix is a simple way to entirely bypass this caching behavior with
just public subclasses that turn off just the caching behavior.
was:
Avro holds a cache of classloaders and other reflection related classes in a
static map here:
https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java#L52-L57
Keys of that map are `String`s with classname.
The cache is never updated, and this breaks OSGi ability to update a new class
definition, since avro **will keep pointing to the old version**.
This will lead to a situation where, on an OSGi platform, you are exposed to
`ClassCastException` since the rest of the platform might see a different
varsion than the old one cached by avro.
The attached fix is a simple way to entirely bypass this caching behavior with
just public subclasses that turn off just the caching behavior.
> [Avro] Issue on OSGi due to static cache
> ----------------------------------------
>
> Key: CAMEL-10282
> URL: https://issues.apache.org/jira/browse/CAMEL-10282
> Project: Camel
> Issue Type: Bug
> Components: camel-avro
> Affects Versions: 2.17.3
> Reporter: Paolo Antinori
>
> Avro holds a cache of classloaders and other reflection related classes in a
> static map here:
> https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java#L52-L57
> Keys of that map are {{String}}s with classname.
> The cache is never updated, and this breaks OSGi ability to update a new
> class definition, since avro *will keep pointing to the old version*.
> This will lead to a situation where, on an OSGi platform, you are exposed to
> {{ClassCastException}} since the rest of the platform might see a different
> varsion than the old one cached by avro.
> The attached fix is a simple way to entirely bypass this caching behavior
> with just public subclasses that turn off just the caching behavior.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)