Index: WebContainer.java =================================================================== RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/WebContainer.java,v retrieving revision 1.100.2.16 diff -u -r1.100.2.16 WebContainer.java --- WebContainer.java 9 Dec 2008 13:15:44 -0000 1.100.2.16 +++ WebContainer.java 10 Mar 2009 18:41:27 -0000 @@ -1128,6 +1128,23 @@ ConfigContext eventConfigContext = j2eeAppBean.getConfigContext(); //end Hercules: add String j2eeApplication = appDesc.getRegistrationName(); + + /* + * START IT 6849: Create work directory up to the EAR file's + * name beforehand, in order to avoid race condition later on, + * when each of the EAR file's bundled webapps is started + */ + if (j2eeApplication != null && !"".equals(j2eeApplication) && + _appsWorkRoot != null) { + StringBuilder dir = new StringBuilder(); + dir.append(_appsWorkRoot); + dir.append(File.separator); + dir.append(FileUtils.makeFriendlyFilename( + j2eeApplication.trim())); + new File(dir.toString()).mkdirs(); + } + // END IT 6849 + Set wbds = appDesc.getWebBundleDescriptors(); WebBundleDescriptor wbd = null; com.sun.enterprise.config.serverbeans.WebModule wm = null; @@ -3456,6 +3473,23 @@ ConfigContext eventConfigContext = j2eeAppBean.getConfigContext(); //end Hercules: add String j2eeApplication = appDesc.getRegistrationName(); + + /* + * START IT 6849: Create work directory up to the EAR file's + * name beforehand, in order to avoid race condition later on, + * when each of the EAR file's bundled webapps is started + */ + if (j2eeApplication != null && !"".equals(j2eeApplication) && + _appsWorkRoot != null) { + StringBuilder dir = new StringBuilder(); + dir.append(_appsWorkRoot); + dir.append(File.separator); + dir.append(FileUtils.makeFriendlyFilename( + j2eeApplication.trim())); + new File(dir.toString()).mkdirs(); + } + // END IT 6849 + Set ebds = appDesc.getExtnBundleDescriptors(); WebBundleDescriptor wbd = null; WebModuleConfig wmInfo = null;