Bug 48366 - Class HostConfig uses File.list() method's result to deploy webapp
Summary: Class HostConfig uses File.list() method's result to deploy webapp
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.20
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-10 06:10 UTC by HellyGuo
Modified: 2009-12-10 06:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description HellyGuo 2009-12-10 06:10:54 UTC
The method ,File.list(),is not always returned a sorted array of String. In my test, under WinXPSP3/SunJDK1.5 or Debian5.02/SunJDK1.6 or AIX5.3/IBMJDK1.5, it works well. But, under RHEL4/SunJDK1.5, this method returned an out-of-order array of String. My webapps need to be loaded in order. This result let them breakdown.
So,I think HostConfig.java should be modified like this:
HostConfig.java Line490:
before
        // Deploy XML descriptors from configBase
        deployDescriptors(configBase, configBase.list());
        // Deploy WARs, and loop if additional descriptors are found
        deployWARs(appBase, appBase.list());
        // Deploy expanded folders
        deployDirectories(appBase, appBase.list());
after
        // Deploy XML descriptors from configBase
        String[] configFiles = configBase.list();
        Arrays.sort(configFiles, 0, configFiles.length);
        deployDescriptors(configBase, configFiles);
        // Deploy WARs, and loop if additional descriptors are found
        String[] appFiles = appBase.list();
        Arrays.sort(appFiles, 0, appFiles.length);
        deployWARs(appBase, appFiles);
        // Deploy expanded folders
        deployDirectories(appBase, appFiles);
Comment 1 Mark Thomas 2009-12-10 06:27:35 UTC
Web applications are meant to be independent. There is no guarantee on load order.

There are better ways to achieve what you are trying to achieve. These have been discussed several times on the users list. Please ask any further questions you have on this topic there.