You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2014/11/21 07:41:34 UTC

[jira] [Commented] (CAMEL-8020) camel-quartz2 - OSGi friendly classloader helper

    [ https://issues.apache.org/jira/browse/CAMEL-8020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14220593#comment-14220593 ] 

Willem Jiang commented on CAMEL-8020:
-------------------------------------

I just  went through the mail and the code of CascadingClassLoadHelper, and found that job is misfired when the bundle is uninstalled.

The key issue is the user exposing the StdSchedulerFactory as a OSGi service, it's hold the reference of the ClassLoadHelper which is work out of the box in OSGi world.

When the bundle is install, the TCCL (BundleClassLoader) is used for setup the camel job and it is remembered by CascadingClassLoadHelper, when the bundle is uninstalled, the BundleClassLoader is still there but it cannot load any class.  As the Scheduler is still there and the camel job is fired, it makes sense that we can get "Caused by: java.lang.IllegalStateException: Bundle "Quartz2_Camel_Test_5Min" has been uninstalled" .



> camel-quartz2 - OSGi friendly classloader helper
> ------------------------------------------------
>
>                 Key: CAMEL-8020
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8020
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-quartz2
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 2.15.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Quartz-job-data-deletion-in-clustered-quartz2-tp5757508p5758609.html
> We need to implement org.quartz.spi.ClassLoadHelper and add support for loading classes from osgi by using the classresolver api from camel context.
> Then this likely helps in osgi situations where bundles can come and go. And so if a bundle gets uninstalled then it wont fail as with the quartz default impl as it would remember the old classloader that used to work, but that wont work anymore as osgi uninstalled the bundle.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)