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/06/11 22:14:00 UTC

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

Andreas Schaefer created SLING-8483:
---------------------------------------

             Summary: 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
             Fix For: Feature Model Launcher 1.0.4


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 will handle() method returns true the content extension's Content Handler is never invoked and hence there is not 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
(v7.6.3#76005)