Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12833

Channel Info Mixins classloading issue in case no Channel Info class configured

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.2.0
    • site-toolkit
    • None

    Description

      This relates to HSTTWO-4704 and HSTTWO-4321

      In org.hippoecm.hst.platform.configuration.channel.ChannelUtils#getChannelInfo there is code at the end that can fail :

      T parametersInfo = (T) factory.createInvokerProxy(proxyClasses[0].getClassLoader(), invoker, proxyClasses);
      

      The proxyClasses are a combination of the Channel Info class and the Channel Info Mixins, see HSTTWO-4321. However, if there is no hst:channelinfoclass specified, the Channel Info class will be

      org.hippoecm.hst.configuration.channel.ChannelInfo
      

      and proxyClasses[0] will refer to this class. This class however is an interface from the hst-api which is part of the shared lib and has the shared classloader as classloader.

      Since the mixin classes (proxyClasses[1.....x]) are classes part of the end project, they have the website webapp classloader! As a result,

      T parametersInfo = (T) factory.createInvokerProxy(proxyClasses[0].getClassLoader(), invoker, proxyClasses);
      

      will fail because the shared class loader doesn't see the mixin classes.

      Instead of proxyClasses[0].getClassLoader(), always the website classloader should be used since that one can also see the shared classes

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: