[
https://issues.apache.org/jira/browse/CAMEL-10573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15742772#comment-15742772
] John Poth commented on CAMEL-10573: ----------------------------------- Hi [~davsclaus], Thanks for looking into this! So this PR aligns the way FallbackTypeConverters are loaded in [Camel-OSGI|https://github.com/apache/camel/blob/d5f0aefdffc74ac0971b87946a21fe4be8c305b4/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L428] and in [plain|https://github.com/apache/camel/blob/00fef5857c0bcb0fc7a02f19f5ba51ef0382133d/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java#L170] Camel. As you can see there is no annotation check in the latter. I didn't remove the other annotation check you mentioned because it is in line with what plain Camel [does|https://github.com/apache/camel/blob/00fef5857c0bcb0fc7a02f19f5ba51ef0382133d/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java#L130]. The motivation behind this alignment is that, in Camel/OSGI, Camel-jackson's [FallbackTypeConverter|https://github.com/apache/camel/blob/2b4b9df67da4b84cb69d9dd42ef77155a803679a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java] is not loaded. This is best illustrated by the added [test|https://github.com/apache/camel/pull/1336/commits/e333e30d7f949239568d73842814934dc765c061#diff-e20859f5602a97731366eeb0d843ae4a] in my PR. As there was no TypeConverter testing, I created my own (may be a good base to test other TypeConverters?). I'd be happy to propose other solutions if alignment doesn't seem like a good idea :) Thanks! John. > Align FallbackTypeConverter loading in OSGI environments > -------------------------------------------------------- > > Key: CAMEL-10573 > URL: https://issues.apache.org/jira/browse/CAMEL-10573 > Project: Camel > Issue Type: Bug > Components: osgi > Reporter: John Poth > Assignee: John Poth > > In a OSGI environment only, FallBackTypeConverters are > [required|https://github.com/apache/camel/blob/d5f0aefdffc74ac0971b87946a21fe4be8c305b4/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L428] > to be annotated with @Converter whereas otherwise they are > [not|https://github.com/apache/camel/blob/00fef5857c0bcb0fc7a02f19f5ba51ef0382133d/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java#L170]. > This causes > [camel-jackson's|https://github.com/apache/camel/blob/2b4b9df67da4b84cb69d9dd42ef77155a803679a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java] > FallbackTypeConverter to not be loaded and a > 'NoTypeConversionAvailableException' will be thrown. > I will provide a PR. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
