You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yogu13 <yo...@gmail.com> on 2016/12/15 16:26:18 UTC
camel-core not detecting converters on bundle restart in karaf4
Hi,
I hit across a strange issue with camel 2.16.3 in karaf 4.0.5. The issue is
we have camel with few other components (blueprint, activemq, jaxb etc)
installed in karaf 4. I have a bundle which has route defined along with a
converter (using @converter ) annotation and FQCN mentioned as part of
META-INF/services/org/apache/camel/TypeConverter. On start of karaf the
bundle works fine along with the route. However If i make any changes to
this bundle and refresh it again, I get a exception on invocation of the
route.
org.apache.camel.InvalidPayloadException
No body available of type:com.xxx.xxx.xxx
The bundle state is active and i do not see any errors in karaf log file on
refresh of the bundle. To make this route work again I either have to
restart the camel-core bundle or restart karaf.
Could it be camel-core is not releasing the previous classloader of
refreshed bundle?? Not sure if this has been reported by anyone.
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I don’t know enough about how you are doing this to be sure, but this sounds suspiciously similar to an issue I’ve been fighting for quite a while now. I don’t know if it applies, but you may want to look at the workaround in this ticket ( https://issues.apache.org/jira/browse/CAMEL-9570 <https://issues.apache.org/jira/browse/CAMEL-9570> ) - the one using SimpleCamelBlueprintContext and see if that might help.
> On Dec 15, 2016, at 9:26 AM, yogu13 <yo...@gmail.com> wrote:
>
> Hi,
>
> I hit across a strange issue with camel 2.16.3 in karaf 4.0.5. The issue is
> we have camel with few other components (blueprint, activemq, jaxb etc)
> installed in karaf 4. I have a bundle which has route defined along with a
> converter (using @converter ) annotation and FQCN mentioned as part of
> META-INF/services/org/apache/camel/TypeConverter. On start of karaf the
> bundle works fine along with the route. However If i make any changes to
> this bundle and refresh it again, I get a exception on invocation of the
> route.
>
> org.apache.camel.InvalidPayloadException
> No body available of type:com.xxx.xxx.xxx
>
> The bundle state is active and i do not see any errors in karaf log file on
> refresh of the bundle. To make this route work again I either have to
> restart the camel-core bundle or restart karaf.
>
> Could it be camel-core is not releasing the previous classloader of
> refreshed bundle?? Not sure if this has been reported by anyone.
>
> Regards,
> -Yogesh
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by yogu13 <yo...@gmail.com>.
Hi Claus,
I havent checked upgrading karaf and camel and to be frank its a little
tedious for us to get it upgraded for now but anyways i will try checking
that. I ran down into a similar issue with JPA enabled bundles only to
discover that Hibernate was causing the issue.
https://hibernate.atlassian.net/browse/HHH-9117
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791567.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
One clarification on this (since it really threw me off for a while).
camel-blueprint and camel-spring-dm both include the classes from camel-core-osgi when they are packaged, while camel-scr references them from their own bundle. What that means is if you install camel-blueprint feature, you won’t see camel-core-osgi installed, nor is it required by these two bundles since they included the classes directly.
The camel-scr bundle does require the camel-core-osgi bundle, and the feature for camel-scr will install it. So when you install the camel-scr feature you will see the camel-core-osgi bundle installed as well.
HTH
> On Dec 27, 2016, at 4:56 AM, Claus Ibsen <cl...@gmail.com> wrote:
>
> On Sun, Dec 25, 2016 at 7:10 PM, yogu13 <yo...@gmail.com> wrote:
>> btw whats the use of camel-core-osgi ?? is it mandatory to be installed when
>> working with OSGI?
>>
>
> Yes its automatic a part of camel-blueprint or camel-spring-dm. And
> also in use at camel-scr.
>
> So you get it installed automatic when using OSGi in karaf/servicemix.
>
>
>
>> -Yogesh
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791937.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by Claus Ibsen <cl...@gmail.com>.
On Sun, Dec 25, 2016 at 7:10 PM, yogu13 <yo...@gmail.com> wrote:
> btw whats the use of camel-core-osgi ?? is it mandatory to be installed when
> working with OSGI?
>
Yes its automatic a part of camel-blueprint or camel-spring-dm. And
also in use at camel-scr.
So you get it installed automatic when using OSGi in karaf/servicemix.
> -Yogesh
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791937.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by yogu13 <yo...@gmail.com>.
btw whats the use of camel-core-osgi ?? is it mandatory to be installed when
working with OSGI?
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791937.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by yogu13 <yo...@gmail.com>.
Sure will have it up in couple of hours :)
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791857.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by Claus Ibsen <cl...@gmail.com>.
The unload of type converter was not the right path.
Can you put a small example together that demonstrates this problem
and put up on github or attach as .zip to the JIRA ticket. And make it
so it uses Karaf 4.0.8 and Camel 2.18.1 as we want to use latest
release.
On Thu, Dec 22, 2016 at 11:33 AM, Claus Ibsen <cl...@gmail.com> wrote:
> I logged a ticket
> https://issues.apache.org/jira/browse/CAMEL-10641
>
> However as this is OSGi then its always tricky
>
> On Thu, Dec 22, 2016 at 10:51 AM, Claus Ibsen <cl...@gmail.com> wrote:
>> Hi
>>
>> Yeah I think maybe the Activator in camel-core should upon
>> removeBundle (or maybe even in modifiedBundle if refresh only calls
>> that).
>> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L165
>>
>> There is some logic that registers and scans type converters, but the
>> code does not remove those type converters.
>> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L225
>>
>> This logic is invoked in the register method
>> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L384
>>
>> But the unregister methods is not implemented where it should
>> potentially unregister those type converters it added.
>> Which means the loader should keep state of which type converters it
>> found, so it knows which ones to remove.
>>
>>
>>
>> On Tue, Dec 20, 2016 at 2:36 PM, yogu13 <yo...@gmail.com> wrote:
>>> Is this a defect should i raise a JIRA ?
>>>
>>>
>>> Regards,
>>> -Yogesh
>>>
>>>
>>>
>>> --
>>> View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791744.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by Claus Ibsen <cl...@gmail.com>.
I logged a ticket
https://issues.apache.org/jira/browse/CAMEL-10641
However as this is OSGi then its always tricky
On Thu, Dec 22, 2016 at 10:51 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Yeah I think maybe the Activator in camel-core should upon
> removeBundle (or maybe even in modifiedBundle if refresh only calls
> that).
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L165
>
> There is some logic that registers and scans type converters, but the
> code does not remove those type converters.
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L225
>
> This logic is invoked in the register method
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L384
>
> But the unregister methods is not implemented where it should
> potentially unregister those type converters it added.
> Which means the loader should keep state of which type converters it
> found, so it knows which ones to remove.
>
>
>
> On Tue, Dec 20, 2016 at 2:36 PM, yogu13 <yo...@gmail.com> wrote:
>> Is this a defect should i raise a JIRA ?
>>
>>
>> Regards,
>> -Yogesh
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791744.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Yeah I think maybe the Activator in camel-core should upon
removeBundle (or maybe even in modifiedBundle if refresh only calls
that).
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L165
There is some logic that registers and scans type converters, but the
code does not remove those type converters.
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L225
This logic is invoked in the register method
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java#L384
But the unregister methods is not implemented where it should
potentially unregister those type converters it added.
Which means the loader should keep state of which type converters it
found, so it knows which ones to remove.
On Tue, Dec 20, 2016 at 2:36 PM, yogu13 <yo...@gmail.com> wrote:
> Is this a defect should i raise a JIRA ?
>
>
> Regards,
> -Yogesh
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791744.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by yogu13 <yo...@gmail.com>.
Is this a defect should i raise a JIRA ?
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791744.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by yogu13 <yo...@gmail.com>.
Hello Claus,
I tried the same scenario after upgrading CAMEL to 2.18.1 and KARAF to
4.0.5. I also noticed camel-core fails to detect the converters and ends up
throwing "org.apache.camel.InvalidPayloadException
No body available of type" only when using converters are implemented as
static methods.
When I change the logic to have it implemented as non static method and
created a instance using blueprint, then the converters are detected and
work properly.
Looks like issue with camel in case converters are implemented as static
methods.
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791676.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by Claus Ibsen <cl...@gmail.com>.
Have you tried with newer versions of karaf and camel.
On Fri, Dec 16, 2016 at 2:52 AM, yogu13 <yo...@gmail.com> wrote:
> Any views or ideas on how to come around it?
>
> Let me know if anyother information is needed.
>
> Regards,
> -Yogesh
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791527.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: camel-core not detecting converters on bundle restart in karaf4
Posted by yogu13 <yo...@gmail.com>.
Any views or ideas on how to come around it?
Let me know if anyother information is needed.
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/camel-core-not-detecting-converters-on-bundle-restart-in-karaf4-tp5791503p5791527.html
Sent from the Camel - Users mailing list archive at Nabble.com.