Author: markt Date: Wed Mar 7 21:11:01 2012 New Revision: 1298121 URL: http://svn.apache.org/viewvc?rev=1298121&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52792 More informative error message when something in JNDI can't be found.
Modified: tomcat/trunk/java/org/apache/naming/LocalStrings.properties tomcat/trunk/java/org/apache/naming/NamingContext.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=1298121&r1=1298120&r2=1298121&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/naming/LocalStrings.properties Wed Mar 7 21:11:01 2012 @@ -21,7 +21,7 @@ selectorContext.methodUsingName=Call to 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 +namingContext.nameNotBound=Name [{0}] is not bound in this Context. Unable to find [{1}]. namingContext.readOnly=Context is read only namingContext.invalidName=Name is not valid namingContext.alreadyBound=Name {0} is already bound in this Context Modified: tomcat/trunk/java/org/apache/naming/NamingContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContext.java?rev=1298121&r1=1298120&r2=1298121&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/NamingContext.java (original) +++ tomcat/trunk/java/org/apache/naming/NamingContext.java Wed Mar 7 21:11:01 2012 @@ -274,7 +274,7 @@ public class NamingContext implements Co if (entry == null) { throw new NameNotFoundException - (sm.getString("namingContext.nameNotBound", name.get(0))); + (sm.getString("namingContext.nameNotBound", name, name.get(0))); } if (name.size() > 1) { @@ -369,7 +369,7 @@ public class NamingContext implements Co if (entry == null) { throw new NameNotFoundException - (sm.getString("namingContext.nameNotBound", name.get(0))); + (sm.getString("namingContext.nameNotBound", name, name.get(0))); } if (entry.type != NamingEntry.CONTEXT) { @@ -423,7 +423,7 @@ public class NamingContext implements Co if (entry == null) { throw new NameNotFoundException - (sm.getString("namingContext.nameNotBound", name.get(0))); + (sm.getString("namingContext.nameNotBound", name, name.get(0))); } if (entry.type != NamingEntry.CONTEXT) { @@ -492,7 +492,7 @@ public class NamingContext implements Co if (entry == null) { throw new NameNotFoundException - (sm.getString("namingContext.nameNotBound", name.get(0))); + (sm.getString("namingContext.nameNotBound", name, name.get(0))); } if (name.size() > 1) { @@ -818,7 +818,7 @@ public class NamingContext implements Co if (entry == null) { throw new NameNotFoundException - (sm.getString("namingContext.nameNotBound", name.get(0))); + (sm.getString("namingContext.nameNotBound", name, name.get(0))); } if (name.size() > 1) { @@ -897,8 +897,8 @@ public class NamingContext implements Co if (name.size() > 1) { if (entry == null) { - throw new NameNotFoundException - (sm.getString("namingContext.nameNotBound", name.get(0))); + throw new NameNotFoundException(sm.getString( + "namingContext.nameNotBound", name, name.get(0))); } if (entry.type == NamingEntry.CONTEXT) { if (rebind) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org