karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Commented] (KARAF-2359) DirectoryWatcher for "deploy" directory should be configured to wait until framework start level reaches 60
Date Mon, 18 Nov 2013 10:01:24 GMT

    [ https://issues.apache.org/jira/browse/KARAF-2359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13825236#comment-13825236

Jean-Baptiste Onofré commented on KARAF-2359:

Thanks for the update. I will create another Jira, at least to document this.

> DirectoryWatcher for "deploy" directory should be configured to wait until framework
start level reaches 60
> -----------------------------------------------------------------------------------------------------------
>                 Key: KARAF-2359
>                 URL: https://issues.apache.org/jira/browse/KARAF-2359
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-config
>    Affects Versions: 2.2.11
>         Environment: ServiceMix 4.4.2 and 4.5.1
>            Reporter: metatech
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 2.2.12, 2.3.2, 2.4.0, 3.0.0
> Problem :
> By default, the DirectoryWatcher of Felix scans for new files very early in the start
process.  If a new application bundle is added to the "deploy" directory, it might be detected
and started while the framework start level is still at 30, although the application bundle
start should be postponed until level 60 is reached.  
> If not, a typical problem will be that Camel-core is deployed after the application bundle,
thereby not using the OSGi-aware CamelContext, causing some Camel components not to be found,
with errors such as the following : 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
sql://SELECT 1 from DUAL?dataSourceRef=myDS due to: No component found with scheme: sql
> A hint to the root cause of the problem can be found in the logs :
> CamelNamespaceHandler            | OSGi environment not detected.
> By default, the property "felix.fileinstall.start.level" in file "org.apache.felix.fileinstall-deploy.cfg"
is unconfigured, resulting in the default "0" level being used.  Although this means that
the new bundle's start level will be configured at level 60 (as configured in the "karaf.startlevel.bundle"
property), another unwanted side effect is also observed : there is no wait in method "DirectoryWatcher:run()".
> Solutions :
> To avoid such race conditions between the starting of Camel-core bundle and an application
bundle, it would be safer to explicitly configure the property "felix.fileinstall.start.level"
to 60 in Felix 3.1.x, or property "felix.fileinstall.active.level" to 60 in Felix 3.2.x, or
change the code of DirectoryWatcher to retrieve the default start level, in case it is unspecified
in the properties.

This message was sent by Atlassian JIRA

View raw message