Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20028

Cache issue when mention components need to be reloaded

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 14.7
    • 14.6-rc-1
    • None
    • Windows 11 Pro 64 bit, Firefox 102, using a local instance of XWiki 14.6 on Oracle 19c, Tomcat 9.0.65, Java 17.0.4+11-LTS-179 (Oracle)
    • Unknown
    • N/A
    • N/A
    • Pull Request accepted

    Description

      STEPS TO REPRODUCE

      1. Create an older instance of XWiki (tested with 12.10.11, 13.10.7 and 14.0)
      2. Close the instance
      3. Go to the newer instance (e.g. 14.6) and copy/cut the
        [...]webapps\xwiki

        folder and replace it (first delete the old one) in the same location on the older version

      1. Start XWiki to follow the Distribution Wizard through the upgrade process
      2. Observe the XWiki console

      EXPECTED RESULTS

      No errors/warnings are displayed.

      ACTUAL RESULTS

      In XWiki console, when first starting the server (Step 4) there are some (expected) errors related to mentions like (partial stacktrace):

      2022-07-26 15:34:50,846 [main] ERROR .i.DefaultExtensionInitializer - Failed to initialize local extension [org.xwiki.platform:xwiki-platform-mentions-default/13.10.7]
      java.lang.NoClassDefFoundError: org/xwiki/mentions/internal/MentionsEventExecutor
              at java.base/java.lang.ClassLoader.defineClass1(Native Method)
              at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
              at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
              at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
              at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
              at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
      [....]
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
      Caused by: java.lang.ClassNotFoundException: org.xwiki.mentions.internal.MentionsEventExecutor
              at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
              ... 69 common frames omitted
      2022-07-26 15:34:50,878 [main] ERROR .i.DefaultExtensionInitializer - Failed to initialize local extension [org.xwiki.platform:xwiki-platform-mentions-ui/13.10.7]
      org.xwiki.extension.ExtensionException: Failed to initialize dependency [org.xwiki.platform:xwiki-platform-mentions-default-13.10.7]
              at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtensionDependencyInNamespace(DefaultExtensionInitializer.java:216)
              at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtensionInNamespace(DefaultExtensionInitializer.java:170)
              at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtensionInNamespace(DefaultExtensionInitializer.java:148)
              at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtension(DefaultExtensionInitializer.java:118)
              at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initialize(DefaultExtensionInitializer.java:104)
      [....]
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
      Caused by: org.xwiki.extension.ExtensionException: Extension [org.xwiki.platform:xwiki-platform-mentions-ui/13.10.7] cannot be initialized because its dependency ([org.xwiki.platform:xwiki-platform-mentions-default-13.10.7]) could not.
              at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtensionDependencyInNamespace(DefaultExtensionInitializer.java:207)
              ... 52 common frames omitted

       

      Then, after the instance is accessed in browser, another error is encountered:

      2022-07-26 15:36:16,172 [http-nio-1115-exec-1 - http://localhost:1115/xwiki/bin/ssx/XWiki/Mentions/MentionsMacro?language=en&docVersion=2.1] ERROR .s.DefaultScriptServiceManager - Failed to lookup script service for role hint [mentions] 
      org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.mentions.script.MentionsScriptService] identified by type [interface org.xwiki.script.service.ScriptService] and hint [mentions]
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:204)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:210)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.script.internal.service.DefaultScriptServiceManager.get(DefaultScriptServiceManager.java:65)
              at jdk.internal.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:568)
              at org.apache.velocity.runtime.parser.node.GetExecutor.execute(GetExecutor.java:118)
              at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:722)
              at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:217)
              at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
              at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
              at org.apache.velocity.Template.merge(Template.java:358)
              at org.apache.velocity.Template.merge(Template.java:262)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:280)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:245)
              at com.xpn.xwiki.web.sx.SxDocumentSource.getContent(SxDocumentSource.java:154)
              at com.xpn.xwiki.web.sx.AbstractSxAction.renderExtension(AbstractSxAction.java:86)
              at com.xpn.xwiki.web.sx.AbstractSxAction.render(AbstractSxAction.java:142)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:587)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:289)
              at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
              at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
              at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
              at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
              at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: org.xwiki.component.manager.ComponentLookupException: Can't find descriptor for the component with type [interface org.xwiki.mentions.MentionsConfiguration] and hint [default]
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:212)
              at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:406)
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:355)
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:451)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:201)
              ... 67 common frames omitted

       

      However, the DW seems to complete, but in its logs there is a warning:

      Failed to get fields for class [org.xwiki.mentions.internal.listeners.MentionsCreatedEventListener] because the class [org/xwiki/mentions/internal/MentionsEventExecutor] couldn't be found in the ClassLoader.

      After DW finishes, in console there are also some warnings related also to Mentions:

      2022-07-26 15:51:20,158 [http-nio-1115-exec-9 - http://localhost:1115/xwiki/bin/ssx/XWiki/Mentions/MentionsMacro?language=en&docVersion=3.1] WARN  c.x.x.w.s.SxDocumentSource     - Velocity errors while parsing skin extension [xwiki:XWiki.Mentions.MentionsMacro] with content [.xwiki-mention {
        background-color: $services.mentions.mentionsColor;
        border-radius: 8px;
        padding: 2px 5px 2px 5px;
      }
      
      .xwiki-mention.user.self {
        background-color: $services.mentions.selfMentionsColor;
      }
      
      .xwiki-mention.removed {
        text-decoration: line-through;
      }
      
      blockquote.mention-quote {
        font-size: inherit;
      }]:

      The issue was reproduced when upgrading from XWiki 12.10.11, 13.10.7 and 14.0 and could not be reproduced when upgrading to XWiki 14.5.

      Please find attached below the full logs from upgrading 13.10.7 to 14.6 (Firefox 102/Oracle 19c/ Tomcat 9.0.65).

      Attachments

        1. DW_warning_mentions.png
          83 kB
          Ilie Andriuta
        2. Logs_Tomcat_13_10_7_to_14_6.txt
          88 kB
          Ilie Andriuta

        Issue Links

          Activity

            People

              mleduc Manuel Leduc
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: