5 Replies Latest reply on Jan 25, 2008 10:16 AM by alesj

    Context ClassLoader - Deployers

      This one is a bit more tricky as discussed before.

      Currently, we don't set the context classloader when calling out to the deployers un/deploy.

      The question is, what should the context classloader be?

      There are two possible answers:
      1) The deployment's classloader. i.e. DeploymentUnit.getClassLoader()
      2) The deployer's classloader. i.e. the context classloader of whoever registered the deployer

      The osgi style classloading rules will likely make the deployer classes
      invisible from the application classloader, unless it explicitly imports them or uses
      the old importAll rules (which is still the default).

      Also the deployment's classloader isn't available until the CLASSLOADER stage.

      So I'd propose that (2) is the correct context classloader. The deployer can
      itself set the context classloader to the deployment classloader when required.
      e.g. The EJB deployer does this.