Issue Details (XML | Word | Printable)

Key: SHALE-253
Type: Bug Bug
Status: Resolved Resolved
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Unassigned
Reporter: Craig McClanahan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Shale

JNDI access to data sources configured in Tomcat returns null

Created: 12/Aug/06 06:27 PM   Updated: 21/Aug/06 11:28 PM
Return to search
Component/s: Core
Affects Version/s: None
Fix Version/s: 1.0.3


 Description  « Hide
There was a report on the user mailing list that accessing JNDI via el expressions does not acquire data sources configured in Tomcat. This needs to be tested and, if it fails, fixed.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig McClanahan added a comment - 13/Aug/06 06:28 AM
I was unable to reproduce this problem. Indeed, I was able to build up a scenario that showed the JNDI evaluation through a value binding actually worked. Here's what I did:

* Installed a copy of derbyclient.jar into the common/lib
  directory of my Tomcat 5.5.17 installation (since the
  sample database I had handy was the "Travel Center"
  example that ships with Java Studio Creator 2 Update 1).

* Built a small webapp with the following META-INF/context.xml file:

  <Context path="/my-jndi-test">

    <Resource name="jdbc/travel" auth="Container" type="java.sql.DataSource"
      maxActive="8" maxIdle="4" maxWait="10000" username="travel" password="travel"
      driverClassName="org.apache.derby.jdbc.ClientDriver"
      url="jdbc:derby://localhost:21527/sample"/>

  </Context>

* Inside the application, I evaluated the expression "#{jndi['jdbc/travel']}",
  and I got back a non-null instance of type "org.apache.tomcat.dbcp.dbcp.BasicDataSource"
  which is exactly what I would expect (this is the wrapper class Tomcat 5.5 uses
  around data sources you define like this.

So, as far as I can tell, this feature works as it is supposed to. If anyone can provide a reproducible test case where this does not work, please reopen this issue and attach your example as an attachment.

Craig McClanahan made changes - 13/Aug/06 06:28 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
sean schofield made changes - 21/Aug/06 11:28 PM
Fix Version/s 1.0.3 [ 21750 ]
Fix Version/s 1.0.3-SNAPSHOT [ 21714 ]
Jeff Turner made changes - 09/Aug/07 07:17 AM
Workflow Struts [ 38629 ] Struts - editable closed status [ 42288 ]
Antonio Petrelli made changes - 08/Jan/09 08:56 AM
Workflow Struts - editable closed status [ 42288 ] Struts - editable closed status (temporary) [ 45965 ]
Antonio Petrelli made changes - 08/Jan/09 09:08 AM
Workflow Struts - editable closed status (temporary) [ 45965 ] Struts - editable closed status [ 52661 ]