Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9773

Construction/initialization of custom filter instance, configured in undertow subsystem uses incorrect/undefined TCCL

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 10.1.0.Final, 11.0.0.Final
    • Fix Version/s: 12.0.0.Beta1, 12.0.0.Final
    • Component/s: Web (Undertow)
    • Labels:
      None
    • Environment:

      Windows 10
      Java 1.8.0_112
      WildFly 10.1.Final

    • Steps to Reproduce:
      Hide

      unzip IgniteHandler.zip into $WILDFLY_HOME/modules
      set $IGNITE_HOME and unzip gatekeeper-token-config.xml.zip to that location

      Add a filter and a filter-red in standalone.xml as follows:

      <filter-ref name="igniteHandler" priority="100"/>

      <filter name="igniteHandler" class-name="no.toyota.gatekeeper.handler.IgniteHandler" module="no.toyota.gatekeeper:simplified"/>

      Show
      unzip IgniteHandler.zip into $WILDFLY_HOME/modules set $IGNITE_HOME and unzip gatekeeper-token-config.xml.zip to that location Add a filter and a filter-red in standalone.xml as follows: <filter-ref name="igniteHandler" priority="100"/> <filter name="igniteHandler" class-name="no.toyota.gatekeeper.handler.IgniteHandler" module="no.toyota.gatekeeper:simplified"/>
    • Workaround Description:
      Hide

      A workaround was provided by https://developer.jboss.org/people/jaikiran

      public IgniteHandler() {
      final ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
      try

      { Thread.currentThread().setContextClassLoader(TokenBouncerHandler.class.getClassLoader()); // rest of your existing code goes here .... }

      finally

      { Thread.currentThread().setContextClassLoader(oldCL); }

      Show
      A workaround was provided by https://developer.jboss.org/people/jaikiran public IgniteHandler() { final ClassLoader oldCL = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(TokenBouncerHandler.class.getClassLoader()); // rest of your existing code goes here .... } finally { Thread.currentThread().setContextClassLoader(oldCL); }

      Description

      Custom module class loading fails with ClassNotFoundException

      I have attached a reproducible example here but it is also available on the forum thread mentioned.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swd847 Stuart Douglas
                Reporter:
                tisaksen Thomas Isaksen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: