3 Replies Latest reply on May 19, 2009 3:33 PM by Scott Stark

    POST_CLASSLOADER not having a fully usable class loader

    Scott Stark Master

      An issue Emanuel is running into is that a DeploymentStages.REAL deployer does not have a deployment class loader capbable of loading classes referenced by deployment metadata. This is apparently due to the deployment class loader being injected:

      <deployment xmlns="urn:jboss:bean-deployer:2.0">
       <classloader><inject bean="bindings-classloader:0.0.0"/></classloader>
       <classloader name="bindings-classloader" xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY" import-all="true">

      Its one thing for this to be an arbitrary bean, but in this case it seems that we should be able to create the class loader prior to the POST_CLASSLOADER.

      In general, what is the point of having a class loader not be usable until the REAL phase?

      Every POST_CLASSLOADER and later deployer that needs to load classes via the deployment class loader will fail.

        • 1. Re: POST_CLASSLOADER not having a fully usable class loader
          Adrian Brock Master

          The "deployment" you are talking about doesn't go through the deployers at all,
          so there is no POST_CLASSLOADER or REAL.

          It is a part of the bootstrap "before" the deployers exist.

          For something that does go through the deployers, you shouldn't use the MC "classloader"
          element, you should use a META-INF/jboss-classloading.xml that the deployers know about.

          • 2. Re: POST_CLASSLOADER not having a fully usable class loader
            Brian Stansberry Master

            Emanuel reported that packaging the -jboss-beans.xml in the jar and deploying the jar instead of a bare jboss-beans.xml solved the problem. I figured it should work packaged as a sar as well, so he's going to try that.. That should suffice until AS 6 when AIUI there should be no need for the binding service to deploy before deployers.

            • 3. Re: POST_CLASSLOADER not having a fully usable class loader
              Scott Stark Master

              It should really just be a bindingservice.beans with a META-INF/jboss-beans.xml since we don't deploy any services, but I suppose it does not really matter.

              Note that I have broken up the ServiceBindingManagedObjectsTestCase tests into:

              org.jboss.test.profileservice.test.ServiceBindingManagedObjectsTestCase - basic managed object testing
              org.jboss.test.profileservice.override.test.ServiceBindingManagedObjectsTestCase - creates and updates binding sets, standard bindings
              org.jboss.test.profileservice.override.restart.test.ServiceBindingManagedObjectsTestCase - validates the the override changes are persisted across server restarts.