Index: TldConfig.java =================================================================== RCS file: /m/jws/appserv-webtier/src_imported/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java,v retrieving revision 1.12.24.4 diff -u -r1.12.24.4 TldConfig.java --- TldConfig.java 23 Mar 2006 05:33:34 -0000 1.12.24.4 +++ TldConfig.java 23 Mar 2006 08:10:27 -0000 @@ -75,7 +75,14 @@ private static final String FILE_URL_PREFIX = "file:"; private static final int FILE_URL_PREFIX_LEN = FILE_URL_PREFIX.length(); - + + // START CR 6402120 + /** + * The variable that indicates whether a single or multiple JVMs + * are running + */ + private static boolean isSingleProcess = true; + // END CR 6402120 /* * Initializes the set of JARs that are known not to contain any TLDs @@ -209,7 +216,29 @@ } // END SJSAS 8.1 5049111 - + // START CR 6402120 + /** + * Sets the flag that indicates whether a single + * or multiple JVMs are running. + * + * @param isSingleProcess true for a single JVM process, false otherwise + */ + public static void setSingleProcess(boolean isSingleJVM) { + isSingleProcess = isSingleJVM; + if (log.isDebugEnabled()) { + log.debug("Are multiple JVMs running ? " + (!isSingleProcess)); + } + } + + /** + * Check if multiple JVMs are running + * + * @return true if a single JVM is running, false otherwise + */ + public static boolean isSingleProcess() { + return isSingleProcess; + } + // END CR 6402120 /** * Set the validation feature of the XML parser used when @@ -291,7 +320,15 @@ File tldCache=null; + /* CR 6402120 if (context instanceof StandardContext) { + */ + // START CR 6402120 + // If multiple JVMs are running, then do not create tldCache.ser + // file as it will cause exceptions on the server side + // because of unsynchronized access of tldCache.ser file. + if ((context instanceof StandardContext) && TldConfig.isSingleProcess()) { + // END CR 6402120 File workDir= (File) ((StandardContext)context).getServletContext().getAttribute(Globals.WORK_DIR_ATTR); tldCache=new File( workDir, "tldCache.ser");