3 Replies Latest reply on Nov 14, 2006 1:43 PM by starksm64

    Default values for MC annotations when running in jboss

    kabirkhan

      Forking http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985741#3985741

      "kabir" wrote:

      "bstansberry@jboss.com" wrote:

      3) I tried adding another attribute "boolean registerDirectly() default false;" to @JMX. But the deployment of any beans where it didn't specify the attribute failed in SimpleAnnotationValidator, which makes no attempt to read default values.

      Default values can be read, but the java reflection api kindly does not allow us a way to read them. If javassist is on the classpath these values can be read. Since the container jars are in jboss/lib:
      a) We need to move javassist from jboss/server/xxx/lib to jboss/lib so that the mc classloader can see javassist
      OR
      b) I could do something similar to what I have done for the other AOP integration and do a check for when javassist has been deployed.

      I will look into b), but for now you should be able to make progress with a) (which is what we might end up with anyway :-)


      I have taken the easiest path and committed option a): moving javassist.jar into jboss/lib. There is a test in the testsuite that verifies the behaviour.

      Kabir@KabirDell ~/sourcecontrol/jboss-head/testsuite
      $ build.sh one-test -Dtest=org.jboss.test.aop.test.MicrocontainerDefaultAnnotationUnitTestCase
      


      Scott, you mentioned something early in the other thread about moving javassist.jar here. Can you elaborate a bit please.

      At the moment I don't see a way to go with option b) short of moving the javassist specific annotation stuff out of the mc project into the aop-mc-int project, or splitting jboss-container.jar into a jboss-container-boot.jar and a jboss-container-deployer.jar as has been done for the aop-mc-int project.

        • 1. Re: Default values for MC annotations when running in jboss
          starksm64

           

          "kabir.khan@jboss.com" wrote:

          Scott, you mentioned something early in the other thread about moving javassist.jar here. Can you elaborate a bit please.

          At the moment I don't see a way to go with option b) short of moving the javassist specific annotation stuff out of the mc project into the aop-mc-int project, or splitting jboss-container.jar into a jboss-container-boot.jar and a jboss-container-deployer.jar as has been done for the aop-mc-int project.


          The javassist issue is simply do we want to expose this api from the bootstrap class loader. Its a question of how public an api javassist is, and do we expect users to be able to use a different version than that bundled with jboss. If we do, then we should be created a javassist release under the org.jboss package namespace to isolate our usage from users.


          • 2. Re: Default values for MC annotations when running in jboss
            kabirkhan

            I'm probably missing something here, but how does it make a difference if it is deployed in jboss/lib or jboss/server/xxx/ling wrt to being able to use a different version?

            • 3. Re: Default values for MC annotations when running in jboss
              starksm64

              Its just more difficult to override as the scope of the types bound to this version of javassist expands. The question of whether we should be jarjaring javassist does exist independent of putting it into the bootstrap classpath.