Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-4620

Loading of ParametersInfo class fails within channel manager

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Duplicate
    • 13.2.0
    • None
    • None
    • None
    • Flagged

    Description

      In case of spring managed components, component parameter info class fails to load within channel manager (see example setup below). Works fine outside of channel manager

      [ContainerItemComponentResource.getVariant:128] Failed to retrieve parameters.
      java.lang.NullPointerException: null
      	at org.hippoecm.hst.util.ParametersInfoAnnotationUtils.getParametersInfoAnnotation(ParametersInfoAnnotationUtils.java:214) ~[hst-commons-13.2.0.jar:13.2.0]
      	at org.hippoecm.hst.util.ParametersInfoAnnotationUtils.getParametersInfoAnnotation(ParametersInfoAnnotationUtils.java:164) ~[hst-commons-13.2.0.jar:13.2.0]
      	at org.hippoecm.hst.pagecomposer.jaxrs.services.ContainerItemComponentServiceImpl.lambda$represent$0(ContainerItemComponentServiceImpl.java:234) ~[hst-page-composer-13.2.0.jar:13.2.0]
      	at org.hippoecm.hst.pagecomposer.jaxrs.util.PageComposerUtil.executeWithWebsiteClassLoader(PageComposerUtil.java:105) ~[hst-page-composer-13.2.0.jar:13.2.0]
      	at org.hippoecm.hst.pagecomposer.jaxrs.services.ContainerItemComponentServiceImpl.represent(ContainerItemComponentServiceImpl.java:232) ~[hst-page-composer-13.2.0.jar:13.2.0]
      	at org.hippoecm.hst.pagecomposer.jaxrs.services.ContainerItemComponentServiceImpl.getVariant(ContainerItemComponentServiceImpl.java:79) ~[hst-page-composer-13.2.0.jar:13.2.0]
      	at org.hippoecm.hst.pagecomposer.jaxrs.services.ContainerItemComponentResource.getVariant(ContainerItemComponentResource.java:126) [hst-page-composer-13.2.0.jar:13.2.0]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
      	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractIn
      
      @Component
      @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
      @ParametersInfo(type = MyComponentInfo.class)
      public class MyComponent extends CommonComponent {
          private static final Logger log = LoggerFactory.getLogger(MyComponent.class);
      
          @Override
          public void doBeforeRender(final HstRequest request, final HstResponse response) {
              super.doBeforeRender(request, response);
              MyComponentInfo myComponentInfo = getComponentParametersInfo(request);
              log.info("myComponentInfo {}", myComponentInfo.getName());
          }
      }
      
      /mycomponent:
        jcr:primaryType: hst:containeritemcomponent
        hst:componentclassname: myComponent
        hst:iconpath: images/essentials/catalog-component-icons/myComponent.svg
        hst:label: MyComponent
        hst:parametersinfoclassname: org.example.components.MyComponentInfo
        hst:template: my-component-template
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mmilicevic Marijan Milicevic
              Hippo Helpdesk Hippo Helpdesk
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: