Index: web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java =================================================================== --- web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java (revision 55254) +++ web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java (working copy) @@ -104,6 +104,7 @@ import java.security.PrivilegedAction; import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.logging.Logger; @@ -211,7 +212,7 @@ * The set of application parameters defined for this application. */ private List applicationParameters = - new ArrayList(); + new CopyOnWriteArrayList(); /** * The application available flag for this Context. Index: web/web-core/src/main/java/org/apache/catalina/core/ApplicationContext.java =================================================================== --- web/web-core/src/main/java/org/apache/catalina/core/ApplicationContext.java (revision 55254) +++ web/web-core/src/main/java/org/apache/catalina/core/ApplicationContext.java (working copy) @@ -157,7 +157,7 @@ /** * The merged context initialization parameters for this Context. */ - private Map parameters = + private ConcurrentHashMap parameters = new ConcurrentHashMap(); private volatile boolean parametersMerged = false; @@ -1026,16 +1026,14 @@ } List params = context.findApplicationParameters(); - synchronized(params) { - Iterator i = params.iterator(); - while (i.hasNext()) { - ApplicationParameter param = i.next(); - if (param.getOverride()) { - if (parameters.get(param.getName()) == null) - parameters.put(param.getName(), param.getValue()); - } else { - parameters.put(param.getName(), param.getValue()); - } + Iterator i = params.iterator(); + while (i.hasNext()) { + ApplicationParameter param = i.next(); + if (param.getOverride()) { + if (parameters.get(param.getName()) == null) + parameters.putIfAbsent(param.getName(), param.getValue()); + } else { + parameters.put(param.getName(), param.getValue()); } } parametersMerged = true; Index: web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java =================================================================== --- web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java (revision 55254) +++ web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java (working copy) @@ -1533,7 +1533,9 @@ Permission p = perms.next(); pc.add(p); } - loaderPC.put(codeUrl,pc); + PermissionCollection tmpPc = loaderPC.putIfAbsent(codeUrl,pc); + if(tmpPc != null) + pc = tmpPc; } } return (pc); Index: web/web-glue/src/main/java/com/sun/enterprise/web/logger/FileLoggerHandlerFactory.java =================================================================== --- web/web-glue/src/main/java/com/sun/enterprise/web/logger/FileLoggerHandlerFactory.java (revision 55254) +++ web/web-glue/src/main/java/com/sun/enterprise/web/logger/FileLoggerHandlerFactory.java (working copy) @@ -65,20 +65,22 @@ public void postConstruct() { } - public synchronized FileLoggerHandler getHandler(String logFile) { + public FileLoggerHandler getHandler(String logFile) { FileLoggerHandler handler = map.get(logFile); if (handler == null) { handler = new FileLoggerHandler(logFile); if (logFormatter != null) { handler.setFormatter(logFormatter); } - map.put(logFile, handler); + FileLoggerHandler tmpHandler = map.putIfAbsent(logFile, handler); + if(tmpHandler != null) + handler = tmpHandler; } return handler; } - public synchronized void removeHandler(String logFile) { + public void removeHandler(String logFile) { map.remove(logFile); } } Index: web/web-glue/src/main/java/com/sun/enterprise/web/ContextFacade.java =================================================================== --- web/web-glue/src/main/java/com/sun/enterprise/web/ContextFacade.java (revision 55254) +++ web/web-glue/src/main/java/com/sun/enterprise/web/ContextFacade.java (working copy) @@ -313,7 +313,11 @@ regis = (DynamicServletRegistrationImpl) createDynamicServletRegistrationImpl((StandardWrapper) wrapper); - servletRegisMap.put(servletName, regis); + DynamicServletRegistrationImpl tmpRegis = + (DynamicServletRegistrationImpl) + servletRegisMap.putIfAbsent(servletName, regis); + if(tmpRegis != null) + regis = tmpRegis; servlets.put(servletName, className); }