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

    Default values for MC annotations when running in jboss

    Kabir Khan Master

      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.