2 Replies Latest reply on Sep 19, 2011 4:13 AM by maheshme973

    Skipping subdirectories during JBoss startup

    maheshme973

      We have an application that users use to upload and download documents and other content (a kind of document management system). The way the application is written, the uploaded content gets deposited inside subdirectories inside the application directory (which is inside the JBoss deploy directory).

      e.g. we have directories as below

       

      /jboss-4.2.3.GA/server/default/deploy/dms.ear/dms.war/WEB-INF

      /jboss-4.2.3.GA/server/default/deploy/dms.ear/dms.war/<Other application directories>

      /jboss-4.2.3.GA/server/default/deploy/dms.ear/dms.war/<DMS content for User Group 1>/<User files>

      /jboss-4.2.3.GA/server/default/deploy/dms.ear/dms/war/<DMS content for User Group 2>/<User files>

       

      Over a period of time, these files have grown to over 300,000 in number. As a result, JBoss takes several minutes to startup. I guess this is because the deployer inspects every file inside the war directory. Though none of the user uploaded files need to be loaded, recursing through the directory structure to inspect each file does take time.

       

      Is there any way to instruct the JBoss deployer to skip these directories during startup?

       

      http://community.jboss.org/message/165972 talks about skipping file types. But that doesn't work for us because all files would need to be read from the filesystem which is what causes the delay today.

       

      thanks,

      mm

        • 1. Re: Skipping subdirectories during JBoss startup
          jaikiran

          Is this JBoss AS 4.2.3? I don't see a reason why the server would look for files in that location during startup.

           

          P.S: This is exactly one of the reasons why it is a bad idea to upload content into some folder within the application, at runtime.

          • 2. Re: Skipping subdirectories during JBoss startup
            maheshme973

            Thanks for the reply Jaikiran.

             

            Yes, this is JBoss 4.2.3. I confirmed that the server does a recursive scan through all the files inside the application. By moving all the content directories out temporarily, the application deplolys in a few seconds (of course the functionality doesn't work as the required content files are not available).

             

            And I agree, it is a terrible idea to put content into the application directory. Unfortunately, the problem is too deep-rooted in the code to do anything about.

             

            thanks,

            mahesh