0 Replies Latest reply on Nov 7, 2012 9:57 PM by bondchan921

    jboss 5.1.0: mbean DeploymentScanner returns partial element by invoking from code regards to by invoking from jmx

    bondchan921

      Hi,

       

      1)I'm upgrading from jboss 4.2.3 to jboss 5.1.0, we need to get the full deployedlist, by check the suffix to get our jar/sar/war and further to read our configuration file from each jar/sar/war

       

      2)we used MainDeployer to lookup all the deployedlist by call getDeployed() before, with in jboss 5.1.0 this method return empty list now, we turn to use DeploymentScanner, the problem is I can get a full list by invoke the method listDeployedURLs() from jmx, by only last 25 of the list elements by invoke from code, while from jmx having 184 elements

       

      3)this mbean is deployed at the end by putting it in file deploy/jboss-service-config.last/jboss-service.xml

       

       

      <server>

                          <!-- Module extended metadata service for Firmament -->

                          <mbean code="com.lombardrisk.f3.metadata.ModuleMetadata" name="Firmament:service=ModuleMetadata" >

                                    <depends>jboss.deployment:type=DeploymentScanner,flavor=URL</depends>

                                    <attribute name="ConfigFile">META-INF/lombard.xml</attribute>

                          </mbean>

       

       

                          <mbean code="com.lombardrisk.f3.database.DatabaseVersion" name="Firmament:service=DatabaseVersion" >

                                    <depends>Firmament:service=ModuleMetadata</depends>

                                    <depends>jboss.jca:service=DataSourceBinding,name=LoginDS</depends>

                                    <attribute name="ModuleName">f3</attribute>

                                    <attribute name="IgnoreVersion">DEV</attribute>

                          </mbean>

       

       

      </server>

       

       

       

      key part of the code:

       

      public class ModuleMetadata extends ServiceMBeanSupport implements NotificationListener, ModuleMetadataMBean {

       

         protected void startService() throws Exception {

            source = new ObjectName("jboss.deployment:type=DeploymentScanner,flavor=URL");//jboss 5

            deployments = (String[])server.invoke(source,"listDeployedURLs",null,null);

       

        }

       

       

      }