2 Replies Latest reply on Nov 8, 2006 5:56 AM by Scott Stark

    How should deployers obtain a propper CL?

    Jason Greene Master

      The WS deployer needs to obtain a correct CL during deployment (needed for annotations, reflection, and JAXB). Currently it builds its own. Is a standard method for doing this planned?

      Or, is a deployer expected to define a ClassLoaderFactory which builds a CL off of the context ClassPath?


        • 1. Re: How should deployers obtain a propper CL?
          Ales Justin Master

          Look at AbstractTopLevelClassLoaderDeployer (and its test: TestClassLoaderDeployer).

          You can define a CL in your -beans.xml for all beans or for a single bean.
          And you can probably use the same CL in deployer - for instance through KernelDeployment (see BeanDeployer).

          • 2. Re: How should deployers obtain a propper CL?
            Scott Stark Master

            The class loader should already be defined for all deployers other than class loading deployers and access via the DeploymentUnit.getClassLoader/DeploymentContext.getClassLoader. A class loading deployer should have already run and built the class loader from the classpath(or overriding metadata).

            The point of removing the class loader construction out of base functionality of each deployer was to allow for more control over the class loading implementation and integration with deployment lifecycle issues.

            However, most deployers are still creating child class loaders of the DeploymentUnit/DeploymentContext class loader, or creating the own class loader just using the DeploymentUnit/DeploymentContext classpath. Extracting this aspect is still a work in progress.