Expand my Community achievements bar.

Wrong path in resource after upgrade

Avatar

Level 3

Hello
Got a problem after upgrading ai from 6.5.14 to 6.5.15.


Prior to this, the component worked without problems, but after the upgrade, it began to work incorrectly.

The component does not work correctly only on the publish node.

 

As I understand it, different types of resources are returned, but I can't find why.

An example is the pictures in the author and the publisher. With the same page and the same component.

AUTHOR (correct)

Screenshot at Feb 16 20-08-52.png

PUBLISH (not correct)

Screenshot at Feb 16 20-05-59.png

Codebase was not updated only AEM 6.5.15 was applied. 

Tell me what could be the problem, please? Thank you very much in advance.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

13 Replies

Avatar

Employee Advisor

I am not sure if your screenshot shows the same component.

The first screenshot shows a resource with the resourcetype "ProductTile2016" while the second shows a resource with the resourcetype "productTileReference".

 

 

 

Avatar

Level 3

I found that I can not determine (find the resource along the path) and I can not understand why, since the type of the resource is passed.

I checked and I'm getting resource type url = myApp/ecommerce/components/productTile2016

new.png

 

Screenshot at Feb 19 03-43-34.pngScreenshot at Feb 19 03-43-59.png

No changes were made to the codebase. Only the new AEM 6.5.15 service package was applied. Before the new package, worked perfectly. All bundles are active.

Avatar

Employee Advisor

All I could think of is a permission problem... Can you paste the the 3rd screenshot with the error message again, the path is not completely visible.

Avatar

Level 4

I added a full log. A changed the project name on MY_PROJECT because I can't show it here.

13.03.2023 10:14:22.372 *ERROR* [127.0.0.1 [1678702457936] GET /en_us/index.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 173 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 174 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 182 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 183 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 191 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 211 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 219 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 239 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 247 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 267 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 275 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 295 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 303 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 323 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 331 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 351 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 359 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 379 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 387 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 407 common frames omitted
Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier .html cannot be correctly instantiated by the Use API
	... 415 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: Identifier .html cannot be correctly instantiated by the Use API
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:77)
	at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:77)
	at org.apache.sling.scripting.sightly.apps.MY_PROJECT.ecommerce.components.productTile2016.productTile2016_html.render(productTile2016_html.java:170)
	at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50)
	at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:60)
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386)
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
	... 435 common frames omitted
Caused by: org.apache.sling.scripting.sightly.SightlyException: Cannot resolve template .html for script /apps/MY_PROJECT/ecommerce/components/productTile2016/productTile2016.html
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.RenderUnitProvider.provide(RenderUnitProvider.java:105)
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:72)
	... 442 common frames omitted

 

Avatar

Employee Advisor

The code throwing this exception is around [1]; I don't have the exact bundle version at hand, so the line numbers are a bit off, but most likely the logic is the same.

 

Line 95f in that branch suggests that the resource /apps/MY_PROJECT/ecommerce/components/productTile2016/productTile2016.html does not exist, and therefor the logic branches into a lookup if that resourcetype is present via a bundled render unit (which is IIRC not used in AEM 6.5.x), which eventually fails with the mentioned exception.

 

Can you check for this resource on your publish instances? And can you please provide the version number for the "Apache Sling Scripting HTL Engine" bundle?

 

 

[1] https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/f82fec6ea2804e50497bd27d7c34...

Avatar

Level 4

Resource presented on publish node.

Screenshot at Apr 09 16-54-41.png

Also if I added a full path to the component with .html extension error is not presented but presented in other components. Look likes aem doesn't find component by resourceType?

Screenshot at Apr 09 17-15-47.png

Apache Sling Scripting HTL Engine
Symbolic Nameorg.apache.sling.scripting.sightly
Version1.1.2.1_4_0
Bundle Locationlaunchpad:resources/install/20/org.apache.sling.scripting.sightly-1.1.2-1.4.0.jar
Last ModificationFri Nov 18 07:56:40 UTC 2022
Bundle Documentationhttp://sling.apache.org
VendorThe Apache Software Foundation
DescriptionThe Apache Sling Scripting HTL Engine is a Java implementation of the HTML Template Language specification. The bundle contains the HTL script engine and its runtime implementation.
Start Level20

Avatar

Employee Advisor

So the exception is triggered at [1]. This branch is entered when the 'renderUnitResource' resource is not resolved (line 90f).You already ruled the fact that the node is missing, so it leaves the option that permissions are wrong (the "sling-scripting" user is used to read those, but by default complete /apps is available to that user).

 

But to debug further one would need to have access to that system (otherwise it's poking in the dark).

 

 

 

[1] https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/71ee6c2971c8dda772a93401bd9d...

Avatar

Level 4

I got you. Thanks a lot. But I don't catch error and understand why this issue appeared only publish node.

Avatar

Employee Advisor

Sorry, no. I ran out of ideas how to approach that problem systematically; personally I would now start poking around in the system

Avatar

Level 4

I think I found the reason.

We are using com.cognifide.cq 2.0.4 version.

I still can't figure out what could affect the code from the new service package.

In our code, the method that receives the parameter from the request is overridden, and if it is not null, then it should return true. But for some reason, all the parameters that we receive return zero. And therefore, an incorrect link is built further, which causes an error.

 

/**
     * Checks if the processor accepts the request
     *
     * @Param request The request
     * @Return True when accepted, else false.
     */
    @Override
    public boolean accepts(SlingHttpServletRequest request) {
        IncludeGenerator generator = this.generatorFactory.getGenerator(this.config.getIncludeTypeName());
        if (generator instanceof AppIncludeGenerator && ((AppIncludeGenerator) generator).ignoreRequestParameters()) {
            Object servletPath = request.getAttribute("javax.servlet.include.servlet_path");

            if (servletPath == null) {
                return false;
            } else {
                String resourceType = request.getResource().getResourceType();
                return this.config.isSupportedResourceType(resourceType, request);
            }
        } else {
            return super.accepts(request);
        }
    }

In the new AEM SP uses javax.servlet 4.0.0 version. Maybe this affected.

 

 

 

Avatar

Level 4

Hello.

How I understand the problem with getting SlingHttpServletRequest. 

I am getting requests as org.apache.sling.scripting.core.impl.helper.OnDemandReaderRequest instead of org.apache.sling.api.SlingHttpServletRequest after applay SP 6.5.15

 

package com.project.aem.ecommerce.components;

import com.project.aem.common.utils.RequestParameterUtils;
import com.project.aem.common.utils.StringUtils;
import com.project.aem.ecommerce.common.components.ProductFeatureItem;
import com.project.aem.ecommerce.utils.ProjectHybrisConstants;
import com.project.aem.plugins.widget.CheckBox;
import com.project.aem.plugins.widget.MultiFieldPanel;
import com.citytechinc.cq.component.annotations.*;
import com.citytechinc.cq.component.annotations.editconfig.FormParameter;
import com.citytechinc.cq.component.annotations.widgets.Selection;
import com.citytechinc.cq.component.annotations.widgets.TextField;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.api.scripting.SlingBindings;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Optional;
import org.apache.sling.models.annotations.Via;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import java.util.ArrayList;
import java.util.List;

@Component(value = "Product Tile 2016",
        group = "Project Product Tiles",
        actions = {"text:Product Tile 2016", "-", "edit", "copymove", "delete", "-", "insert"},
        disableTargeting = true,
        tabs = {
                @Tab(title = "Product Tile"),
                @Tab(title = "Classification Features")
        },
        formParameters = {
                @FormParameter(name = "tileVariant", value = "default")
        },
        extraClientlibs = "project-ecommerce.producttile2016-author")
@Model(adaptables = {SlingHttpServletRequest.class})
public class ProductTile2016 {

    private static final Logger LOG = LoggerFactory.getLogger(ProductTile2016.class);
    private static final String FEATURE = "feature";
    @SlingObject
    private SlingHttpServletRequest request;
    @SlingObject
    private ResourceResolver resourceResolver;
    @SlingObject
    private Resource resource;
    @DialogField(fieldLabel = "Product code",
            fieldDescription = "Product code (to visualize in author mode).",
            required = true,
            tab = 1
    )
    @TextField
    
    private String productCode;

    @DialogField(fieldLabel = "Tile variant", defaultValue = "default", tab = 1,
            additionalProperties = {@Property(name = "cq-dialog-dropdown-showhide", value = ""),
                    (name = "class", value = "tile_variant_select"),
                    (name = "cq-dialog-showhide-target", value = ".default_producttile_2020")})
    @Selection(type = "select", options = {
            (text = "Default", value = "default"),
            (text = "Default Support", value = "defaultSupport"),
            (text = "Default 2020 - Static", value = "default2020"),
            (text = "Default 2020 With Compare Button - Static", value = "default2020Compare"),
            (text = "Default 2020 - Dynamic", value = "default2020Dynamic"),
            (text = "Default 2020 With Compare Button - Dynamic", value = "default2020CompareDynamic"),
            (text = "Compare Table Tile", value = "compareTableTile"),
            (text = "Variant A", value = "variantA"),
            (text = "Variant B", value = "variantB"),
            (text = "Variant C", value = "variantC"),
            (text = "Shop", value = "shop"),
            (text = "Special Product", value = "specialProduct"),
            (text = "Variant Line", value = "variantLine"),
            (text = "Variant Pro", value = "variantPro"),
            (text = "Accessories Layout", value = "productDrawerAccLayout"),
    })
    
    
    ("resource")
    private String tileVariant;

    @DialogField(fieldLabel = "Enable Stock", value = "true", tab = 1)
    (text = "Enable Stock", inputValue = "true")
    
    
    ("resource")
    private boolean enableStock;

    @DialogField(fieldLabel = "Enable Buy Overlay", tab = 1,
            additionalProperties = {@Property(name = "class", value = "hide default2020_hide_option")})
    @Selection(type = "checkbox", options = {@Option(text = "Yes", value = "true")})
    
    
    ("resource")
    private boolean enableBuyOverlay;

    @DialogField(fieldLabel = "Hide Review Ratings", value = "true", tab = 1,
            additionalProperties = {@Property(name = "class", value = "hide default2020_show_option")})
    (text = "Hide Review Ratings", inputValue = "true")
    
    
    ("resource")
    private boolean hideReviewRatings;

    @DialogField(fieldLabel = "Low Stock Message color", tab = 1,
            additionalProperties = {@Property(name = "class", value = "hide default2020_show_option")})
    @Selection(type = "select", options = {
            (text = "Grey", value = "-endingSoonGrey"),
            (text = "Red", value = "-endingSoon")
    })
    
    
    ("resource")
    private String stockMessageColor;

    @DialogField(fieldLabel = "Tile Background Color", tab = 1,
            additionalProperties = {@Property(name = "class", value = "hide default2020_show_option")})
    @Selection(type = "select", options = {
            (text = "Light Grey", value = "light-grey"),
            (text = "White", value = "project-productTile2020--white")
    })
    
    
    ("resource")
    private String tileBackgroundColor;

    @DialogField(fieldLabel = "Show Classification Features", defaultValue = "false", tab = 2)
    @Selection(options = {
            (text = "Yes", value = "true"),
            (text = "No", value = "false")
    }
    )
    
    
    ("resource")
    private boolean enableClassificationFeatures;

    @DialogField(fieldLabel = "Product Feature", tab = 2)
    @MultiFieldPanel
    
    
    private List<ProductFeatureItem> feature = new ArrayList<>();

    public String getProductCode() {
        return productCode;
    }

    public boolean getEnableStock() {
        return enableStock;
    }

    public boolean getEnableBuyOverlay() {
        return enableBuyOverlay;
    }

    public boolean isHideReviewRatings() {
        return hideReviewRatings;
    }

    public String getStockMessageColor() {
        return stockMessageColor;
    }

    public String getTileBackgroundColor() {
        return tileBackgroundColor;
    }

    public String getTileVariant() {
        return tileVariant;
    }

    public List<ProductFeatureItem> getFeature() {
        return feature;
    }

    public boolean isEnableClassificationFeatures() {
        return enableClassificationFeatures;
    }

    @PostConstruct
    public void init() throws Exception {
        String code = null;

        if (request != null) {
            code = RequestParameterUtils.getParameter(request, ProjectHybrisConstants.PROPERTY_NODE_PRODUCTCODE);

            if (StringUtils.isEmpty(code)) {
                SlingBindings bindings = (SlingBindings) request.getAttribute(SlingBindings.class.getName());

                Object productCodeBinding = bindings.get(ProjectHybrisConstants.PROPERTY_NODE_PRODUCTCODE);
                if (productCodeBinding != null) {
                    code = productCodeBinding.toString();
                }
                if (StringUtils.isEmpty(code)) {
                    Object resourceBinding = bindings.get("resource");
                    if (resourceBinding != null) {
                        ValueMap properties = ((Resource) resourceBinding).adaptTo(ValueMap.class);
                        if (properties != null) {
                            code = properties.get(ProjectHybrisConstants.PROPERTY_NODE_PRODUCTCODE, String.class);
                        }
                    }
                }
            }

            this.feature = new ArrayList<>();

            Resource featureResource = resourceResolver.getResource(resource.getPath() + "/" + FEATURE);
            if (featureResource != null) {
                Node featureNode = featureResource.adaptTo(Node.class);
                try {
                    NodeIterator it = featureNode.getNodes();
                    while (it.hasNext()) {
                        Node featureItemNode = it.nextNode();
                        ProductFeatureItem productFeatureItem = new ProductFeatureItem();
                        productFeatureItem.setFeatureName(featureItemNode.getProperty(ProductFeatureItem.KEY_FEATURE_NAME).getString());
                        productFeatureItem.setPath(featureItemNode.getProperty(ProductFeatureItem.KEY_PATH).getString());
                        productFeatureItem.setImageAltText(featureItemNode.getProperty(ProductFeatureItem.KEY_IMAGE_ALT_TEXT).getString());
                        this.feature.add(productFeatureItem);
                    }
                } catch (RepositoryException e) {
                    LOG.error("unable to get the feature node items", e);
                }
            }
        }
        if (StringUtils.isNotEmpty(code)) {
            this.productCode = code;
        }
    }
}

 

This is an old model but worked before the upgrade as expected. All fields returned null.

 

Thanks for any advice.

UPDATE

This component works on the author as expected but publish doesn't work after the upgrade.

Rechecked everything I know - no more ideas.