You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Andreas Schaefer (Jira)" <ji...@apache.org> on 2019/08/21 21:41:00 UTC

[jira] [Commented] (SLING-8483) Sling Feature Launcher with Content Package depends on Classpath Order and Needs Package Init Bundle

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

Andreas Schaefer commented on SLING-8483:
-----------------------------------------

Created a PR:

Sling Feature Launcher: [https://github.com/apache/sling-org-apache-sling-feature-launcher/pull/13]

Sling Feature Extension Content: [https://github.com/apache/sling-org-apache-sling-feature-extension-content/pull/14]

 

> Sling Feature Launcher with Content Package depends on Classpath Order and Needs Package Init Bundle
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SLING-8483
>                 URL: https://issues.apache.org/jira/browse/SLING-8483
>             Project: Sling
>          Issue Type: Bug
>          Components: Feature Model
>    Affects Versions: Feature Model Launcher 1.0.2
>         Environment: Java 8, Sling 11, Feature Model 1.0.2
>            Reporter: Andreas Schaefer
>            Assignee: Andreas Schaefer
>            Priority: Major
>             Fix For: Feature Model Launcher 1.1.2
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> There are two issues with the Feature Launcher to support Package Content installation:
>  # The feature extension content needs to be added before the launcher in the class path
>  # For the Content Package deployment to work JCR Package Init needs to be installed
> In the Feature Processor the Content Package Handler from the launcher is called first if the launcher is ahead of the content extension in the class path:
>  
> {code:java}
> extensions: for(final Extension ext : app.getExtensions()) {
>  for (ExtensionHandler handler : ServiceLoader.load(ExtensionHandler.class, FeatureProcessor.class.getClassLoader()))
>  {
>  if (handler.handle(new ExtensionContextImpl(ctx, config.getInstallation(), loadedFeatures), ext)) {
>  continue extensions;
> {code}
> Because this handle() method returns true the content extension's Content Handler is never invoked and hence there is no Execution Plan making the Content Package fail later.
> I think the Extension Handler should issue a priority to select the appropriate one at runtime.
> The Content Package deployment will not work anyhow if the JCR Package Init bundle is not installed prior to deployment. I would suggest that the Launcher should deploy that bundle as it does deploy the Sling Launcher as well. 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)