Summary: | Better error reporting for ConnectionTag and JNDI lookups | ||
---|---|---|---|
Product: | Taglibs | Reporter: | Eric Kramer <ekramer> |
Component: | DBTags Taglib | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | mdelagra |
Priority: | P3 | ||
Version: | 1.0B1 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All |
Description
Eric Kramer
2002-01-18 06:20:41 UTC
Glad you like the tags. :) That JNDI support was contributed, and I don't really use it myself. From the Javadocs on Context.lookup(String), it sounds like an incorrect context string should throw a specific NamingException , not a NullPointerException. Isn't that the case? My read of the JavaDocs at http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#lookup (java.lang.String) didn't seem to indicate that a NamingException would necessarily be thrown if no object is found. It seems that the NamingException is only thrown if a "naming exception is encountered" (whatever that *specfically* means... *smile*). My guess is that the decision to either return null or thrown an exception may be up to the implementor. Again, just my guess. Either way, a check for null seems prudent (to me, having spent a few hours troubleshooting this under Tomcat one rainy weekend). :) I will take a look on this bug later this week... Fixed. The problem was not related to JNDI lookup, but with a DataSource object been set in the JSP context. Here is the message you will get now: org.apache.jasper.JasperException: Did not find a DataSource bean mamed myDS2 |