Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-2064

The Thread Context ClassLoader is not cleaned between jobs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 11.10.11, 12.6.5, 12.10
    • 11.10
    • Job
    • None
    • Unknown
    • N/A
    • N/A

    Description

      As a consequence I got hit in the LaTeX Extension, which, from time to time generate this error:

      interface org.xwiki.contrib.latex.internal.output.LaTeXOutputFilter is not visible from class loader
      class java.lang.IllegalArgumentException: interface org.xwiki.contrib.latex.internal.output.LaTeXOutputFilter is not visible from class loader
          at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:581)
          at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557)
          at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230)
          at java.lang.reflect.WeakCache.get(WeakCache.java:127)
          at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
          at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
          at org.xwiki.filter.internal.DefaultFilterDescriptorManager.createCompositeFilter(DefaultFilterDescriptorManager.java:370)
          at org.xwiki.filter.internal.DefaultFilterDescriptorManager.createCompositeFilter(DefaultFilterDescriptorManager.java:359)
          at org.xwiki.contrib.latex.internal.output.LaTeXOutputFilterStream.createFilter(LaTeXOutputFilterStream.java:215)
      

      The issue seems to be that Job framework reuses threads and if the JVM gives a thread that's been already used and for which a Thread Context CL has already been set, then when AbstractJob executes and recreates the context, ThreadClassloaderExecutionContextInitializer is called but doesn't set a new Thread Context CL since there's one already.

      OTOH if the JVM gives a new thread that's not been used, then it's set correctly and the LaTeX export works fine.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: