From: markt Date: Mon, 8 Feb 2010 16:45:08 +0000 (+0000) Subject: Avoid adding the package twice X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cf48a8b6063a6f7a6cfb03da1c7a965c98e49ad4;p=tomcat7.0 Avoid adding the package twice git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@907720 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java index 57e5a34b2..284a47972 100644 --- a/java/org/apache/catalina/startup/Tomcat.java +++ b/java/org/apache/catalina/startup/Tomcat.java @@ -581,13 +581,19 @@ public class Tomcat { server.addLifecycleListener(new NamingContextListener()); System.setProperty("catalina.useNaming", "true"); + String value = "org.apache.naming"; String oldValue = System.getProperty(javax.naming.Context.URL_PKG_PREFIXES); if (oldValue != null) { - value = value + ":" + oldValue; + if (oldValue.contains(value)) { + value = value + ":" + oldValue; + } else { + value = oldValue; + } } System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, value); + value = System.getProperty (javax.naming.Context.INITIAL_CONTEXT_FACTORY); if (value == null) {