I got my answer in this thread: > Make sure you have the <ResouceLink> Tag inside each context that needs to > use this > datasource. Also, in using Global Resources, there is no need for a > <resource-ref> tag > in your web.xml config file anymore.
iran -----Mensagem original----- De: Iran Marcius [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 20 de dezembro de 2002 13:52 Para: 'Tomcat Users List' Assunto: RES: Is there a problem with tomcat JNDI resources (I don't think so) If I'm not mistaken, I read somewhere that using GlobalNamingResource with ResourceLink (inside Context) make unnecessary to put resource-ref in web.xml. Tomcat naming examples didn't use it too. Is that correct? iran -----Mensagem original----- De: Kevin Passey [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 20 de dezembro de 2002 12:09 Para: 'Tomcat Users List' Assunto: RE: Is there a problem with tomcat JNDI resources (I don't think so) Hi, I've got this in my web xml for the app..Not doing global though. - <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/shiltonDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> Regards Kevin -----Original Message----- From: Iran Marcius [mailto:[EMAIL PROTECTED]] Sent: 20 December 2002 14:06 To: [EMAIL PROTECTED] Subject: Is there a problem with tomcat JNDI resources (I don't think so) Hi fellows. I think I'm doing something wrong, but I can't get a JNDI Datasource configured in GlobalNamingResource section. Here is my configuration: <Resource name="jdbc/global" type="javax.sql.DataSource" auth="Container" scope="Shareable"/> <ResourceParams name="jdbc/global"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> </parameter> <parameter> <name>driverClassName</name> <value>org.postgresql.Driver</value> </parameter> <parameter> <name>url</name> <value>jdbc:postgresql://localhost/global</value> </parameter> <parameter> <name>validationQuery</name> <value>select 1</value> </parameter> <parameter> <name>username</name> <value>global</value> </parameter> <parameter> <name>password</name> <value>password</value> </parameter> </ResourceParams> In my context I have the following: <Context docBase="s:\webapptests" path="/tests" reloadable="true" debug="4"> <ResourceLink name="jdbc/global" global="jdbc/global" type="javax.sql.DataSource"/> </Context> But when I perform the lookup operations in my servlet, got the following error: javax.servlet.ServletException: Name java:comp is not bound in this Context at org.apache.naming.NamingContext.list(NamingContext.java:386) at org.apache.naming.NamingContext.list(NamingContext.java:409) at javax.naming.InitialContext.list(InitialContext.java:387) at com.isic.tests.JNDITestServlet.doGet(JNDITestServlet.java:27) My lookup line is: DataSource ds = (DataSource)ic.lookup("java:comp/env/jdbc/global"); Is it correct? Sometimes I got really confused about these names. Am I missing some configuration in context or web.xml (is resource-ref necessary?). My application is running in a virtual host I created (with a SingleSignOn valve). Could it be the problem? Thanks for any help. iran -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>