5 Replies Latest reply on Jul 7, 2010 4:15 AM by jaikiran pai

    Scanning and JBossCustomDeployDUFilter

    shivani chandna Newbie

      In the Jboss admin guide for 5.1 v the following are the ways suggested for tuning scanning :

       

      • Provide a ScanningMetaData through XML or programmaticaly.
      • Add a new deployment filter to GenScanDeployer bean in deployers/metadata-deployer-jboss-beans.
      • Modify JBossCustomDeployDUFilter in deployers/metadata-deployer-jboss-beans.

       

       

      My queries are as follows:

      1. How would one programmaticaly provide the ScanningMetaData  information?

      2.  For point 3 - JBossCustomDeployDUFilter is of the type VirtualFileDeploymentUnitFilter and uses FileNameVirtualFileFilter to set the filters. On setting TRACE to check the usage of the filter I see the following in server.log:

       

      2010-07-06 11:49:31,944 TRACE [org.jboss.deployment.FileNameVirtualFileFilter] (main) Excluding jmx-console.war
      2010-07-06 11:49:31,944 TRACE [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) Deploying: vfsfile:/C:/setup/jboss5/jboss-5.1.0.GA/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/
      2010-07-06 11:49:31,944 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) vfsfile:/C:/setup/jboss5/jboss-5.1.0.GA/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/ endpoint mappings:
      2010-07-06 11:49:31,944 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) Processing unit=jmx-console.war, structure:jmx-console.war

       

      What is strange is that the jmx-console.war is first kept in exclusion list in the JBossCustomDeployDUFilter  and later deployed.  What then is the intent of  keeping the exclusion pattern like jmx-console.war in this filter? . Can someone explain how this works / expected to work ?

       

       

      <bean name="JBossCustomDeployDUFilter" class="org.jboss.deployers.vfs.spi.structure.helpers.VirtualFileDeploymentUnitFilter">
          <constructor>
            <parameter>
              <bean class="org.jboss.deployment.FileNameVirtualFileFilter">
                <constructor>
                  <parameter>
                    <map keyClass="java.lang.String" valueClass="java.util.Set">
                      <entry>
                        <key>jbossweb.sar</key>
                        <value><null/></value>
                      </entry>
                      <entry>
                        <key>quartz-ra.rar</key>
                        <value><null/></value>
                      </entry>
                      <entry>
                        <key>jmx-console.war</key>
                        <value><null/></value>
                      </entry>
                    </map>
                  </parameter>
                </constructor>
              </bean>
            </parameter>
          </constructor>
        </bean>
      
       
      

       

      Thanks,

      Shivani

        • 1. Re: Scanning and JBossCustomDeployDUFilter
          jaikiran pai Master

          shivani chandna wrote:

           


          2.  For point 3 - JBossCustomDeployDUFilter is of the type VirtualFileDeploymentUnitFilter and uses FileNameVirtualFileFilter to set the filters. On setting TRACE to check the usage of the filter I see the following in server.log:

           

          2010-07-06 11:49:31,944 TRACE [org.jboss.deployment.FileNameVirtualFileFilter] (main) Excluding jmx-console.war
          2010-07-06 11:49:31,944 TRACE [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) Deploying: vfsfile:/C:/setup/jboss5/jboss-5.1.0.GA/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/
          2010-07-06 11:49:31,944 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) vfsfile:/C:/setup/jboss5/jboss-5.1.0.GA/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/ endpoint mappings:
          2010-07-06 11:49:31,944 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) Processing unit=jmx-console.war, structure:jmx-console.war

           

          What is strange is that the jmx-console.war is first kept in exclusion list in the JBossCustomDeployDUFilter  and later deployed.  What then is the intent of  keeping the exclusion pattern like jmx-console.war in this filter? . Can someone explain how this works / expected to work ?

           

           


          That filter is used for enabling/disabling annotation scanning on deployments. So the config you see, filters out jmx-console from annotation scanning, since jmx-console doesn't require any annotation scanning for its classes. That filter isn't meant for excluding deployments from being deployed.

          • 2. Re: Scanning and JBossCustomDeployDUFilter
            shivani chandna Newbie

            What are ways in which we can set the exclusion patterns for deployable files?

            I am aware that the suffix of files can be specified in the file deployers.xml in the tags FileStructure/ JarStructure.

             

            thanks,

            shivani

            • 3. Re: Scanning and JBossCustomDeployDUFilter
              jaikiran pai Master

              shivani chandna wrote:

               

              What are ways in which we can set the exclusion patterns for deployable files?

              I am aware that the suffix of files can be specified in the file deployers.xml in the tags FileStructure/ JarStructure.

               

              The deployers.xml suffix exclusion is the only one that I remember. I haven't looked into other options, mainly because that one single option lets me filter all unwanted deployments. I usually, rename deployments in the deploy folder to have a .bak suffix and that takes care of the exclusion. What other kinds of exclusion are you looking for?

              • 4. Re: Scanning and JBossCustomDeployDUFilter
                shivani chandna Newbie

                I found the configuration required in the file: conf//bootstrap/profiles.xml in the tag DeploymentFilter that has suffix,prefix and matches for setting the exclusion rules for the scanner.

                 

                thanks,

                shivani

                • 5. Re: Scanning and JBossCustomDeployDUFilter
                  jaikiran pai Master

                  Oops, my previous reply was a bit misleading:

                   

                  jaikiran wrote:

                   

                  The deployers.xml suffix exclusion is the only one that I remember.
                  ...
                  I usually, rename deployments in the deploy folder to have a .bak  suffix

                  I actually meant the profile.xml file (which you already found out). Sorry about that.