DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23491>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23491 Can't configure PerUserPoolDataSource for use with tomcat Summary: Can't configure PerUserPoolDataSource for use with tomcat Product: Commons Version: Nightly Builds Platform: Other OS/Version: Other Status: NEW Severity: Critical Priority: Other Component: Dbcp AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] This bug was originally submitted by Mike Hanafey: If have been trying to get connection pooling to work in tomcat 5.0.9 and Sybase. I downloaded a nightly DBCP yesterday, but cannot get the factory right for defining a "PerUserPoolDataSource". The "ctx.lookup" returns null. This what I have in server.xml: <Resource name="jdbc/pubs2new" auth="Container" type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource" description="The infamous pub2 test database"/> <ResourceParams name="jdbc/pubs2new"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.datasources.InstanceKeyObjectFactory</value> </parameter> <parameter> <name>dataSourceName</name> <value>java:comp/env/jdbc/pubsCPDS</value> </parameter> <parameter> <name>defaultMaxActive</name> <value>30</value> </parameter> </ResourceParams> </DefaultContext> I, John McNally, attempted to test this using a <Context> element instead of <DefaultContext> and using Tomcat/4.1.24. <Resource name="pubs" auth="Container" type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource" description="The infamous pub2 test database"/> <ResourceParams name="pubs"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.datasources.InstanceKeyObjectFactory</value> </parameter> </ResourceParams> </Context> And web.xml: <resource-ref> <description> foo </description> <res-ref-name>pubs</res-ref-name> <res-type>org.apache.commons.dbcp.datasources.PerUserPoolDataSource</res-type> <res-auth> Container </res-auth> </resource-ref> >From my debugging, it appears InstanceKeyObjectFactory.getObjectInstance is never called. And the following javax.naming.Context ctx = new javax.naming.InitialContext(); DataSource ds = (DataSource)ctx.lookup("java:comp/env/pubs"); fails with java.lang.ClassCastException: org.apache.naming.ResourceRef --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
