Author: markt Date: Tue Jul 14 21:52:14 2009 New Revision: 794082 URL: http://svn.apache.org/viewvc?rev=794082&view=rev Log: JNDI lookup errors often only include part of the name being looked up. Provide debug logging that includes the complete name and how it was requested.
Modified: tomcat/trunk/java/org/apache/naming/LocalStrings.properties tomcat/trunk/java/org/apache/naming/SelectorContext.java Modified: tomcat/trunk/java/org/apache/naming/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/LocalStrings.properties?rev=794082&r1=794081&r2=794082&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/naming/LocalStrings.properties Tue Jul 14 21:52:14 2009 @@ -17,6 +17,8 @@ contextBindings.noContextBoundToThread=No naming context bound to this thread contextBindings.noContextBoundToCL=No naming context bound to this class loader selectorContext.noJavaUrl=This context must be accessed through a java: URL +selectorContext.methodUsingName=Call to method ''{0}'' with a Name of ''{1}'' +selectorContext.methodUsingString=Call to method ''{0}'' with a String of ''{1}'' namingContext.contextExpected=Name is not bound to a Context namingContext.failResolvingReference=Unexpected exception resolving reference namingContext.nameNotBound=Name {0} is not bound in this Context Modified: tomcat/trunk/java/org/apache/naming/SelectorContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/SelectorContext.java?rev=794082&r1=794081&r2=794082&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/SelectorContext.java (original) +++ tomcat/trunk/java/org/apache/naming/SelectorContext.java Tue Jul 14 21:52:14 2009 @@ -59,6 +59,9 @@ public static final String IC_PREFIX = "IC_"; + private static org.apache.juli.logging.Log log = + org.apache.juli.logging.LogFactory.getLog(SelectorContext.class); + // ----------------------------------------------------------- Constructors @@ -119,6 +122,12 @@ */ public Object lookup(Name name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingName", "lookup", + name)); + } + // Strip the URL header // Find the appropriate NamingContext according to the current bindings // Execute the lookup on that context @@ -135,6 +144,12 @@ */ public Object lookup(String name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingString", "lookup", + name)); + } + // Strip the URL header // Find the appropriate NamingContext according to the current bindings // Execute the lookup on that context @@ -293,6 +308,12 @@ */ public NamingEnumeration<NameClassPair> list(Name name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingName", "list", + name)); + } + return getBoundContext().list(parseName(name)); } @@ -308,6 +329,12 @@ */ public NamingEnumeration<NameClassPair> list(String name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingString", "list", + name)); + } + return getBoundContext().list(parseName(name)); } @@ -327,6 +354,12 @@ */ public NamingEnumeration<Binding> listBindings(Name name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingName", + "listBindings", name)); + } + return getBoundContext().listBindings(parseName(name)); } @@ -342,6 +375,12 @@ */ public NamingEnumeration<Binding> listBindings(String name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingString", + "listBindings", name)); + } + return getBoundContext().listBindings(parseName(name)); } @@ -439,6 +478,12 @@ */ public Object lookupLink(Name name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingName", + "lookupLink", name)); + } + return getBoundContext().lookupLink(parseName(name)); } @@ -454,6 +499,12 @@ */ public Object lookupLink(String name) throws NamingException { + + if (log.isDebugEnabled()) { + log.debug(sm.getString("selectorContext.methodUsingString", + "lookupLink", name)); + } + return getBoundContext().lookupLink(parseName(name)); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org