Author: markt
Date: Thu Jan 25 22:41:56 2018
New Revision: 1822232

URL: http://svn.apache.org/viewvc?rev=1822232&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=62000
 When a JNDI reference cannot be resolved, ensure that the root cause exception 
is reported rather than swallowed.

Modified:
    tomcat/trunk/java/org/apache/naming/NamingContext.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/naming/NamingContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContext.java?rev=1822232&r1=1822231&r2=1822232&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingContext.java Thu Jan 25 22:41:56 
2018
@@ -851,9 +851,11 @@ public class NamingContext implements Co
                 } catch (NamingException e) {
                     throw e;
                 } catch (Exception e) {
-                    log.warn(sm.getString
-                             ("namingContext.failResolvingReference"), e);
-                    throw new NamingException(e.getMessage());
+                    String msg = 
sm.getString("namingContext.failResolvingReference");
+                    log.warn(msg, e);
+                    NamingException ne = new NamingException(msg);
+                    ne.initCause(e);
+                    throw ne;
                 }
             } else {
                 return entry.value;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1822232&r1=1822231&r2=1822232&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jan 25 22:41:56 2018
@@ -59,6 +59,10 @@
         (remm)
       </fix>
       <fix>
+        <bug>62000</bug>: When a JNDI reference cannot be resolved, ensure that
+        the root cause exception is reported rather than swallowed. (markt)
+      </fix>
+      <fix>
         <bug>62036</bug>: When caching an authenticated user Principal in the
         session when the web application is configured with the
         <code>NonLoginAuthenticator</code>, cache the internal Principal object



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to