Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2381

Set web application classloader as TCCL when calling observers

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Major
    • Unscheduled
    • 2.4.2.Final, 2.4.3.Final, 3.0.0.Final, 2.4.4.Final
    • Events
    • None

    Description

      According to EE.6.2.3.7 CDI should be setting a TCCL during the invocation of observer methods. Wildfly uses the CL of the top-level deployment, however other application servers have used web application's ClassLoader. Codebases, such as Apache DeltaSpike, have been written to assume that the TCCL will be the web application's ClassLoader and we would like to preserve compatibility for those codebases.

      While setting the ClassLoader is accepted to be the responsibility of the integrator the design of weld makes it impossible for the integrator. Once we call org.jboss.weld.bootstrap.WeldBootstrap.startInitialization observer methods in multiple different war archives may be called. We cannot set the TCCL for two different web applications at the same time.

      It seems OWB set the TCCL to the web application's classloader. We would like Weld to set the TCCL to the web application's class loader directly before invoking an observer and then set it back after the observer method has completed.

      Attachments

        1. DeltaSpikeTCCL.ear
          339 kB
        2. mavenTCCL.zip
          350 kB
        3. TestExtension.java
          2 kB
        4. TestServlet.java
          1 kB

        Activity

          People

            Unassigned Unassigned
            benjamin-confino Benjamin Confino (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: