Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 14116 invoked from network); 25 Apr 2007 14:08:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Apr 2007 14:08:36 -0000 Received: (qmail 28556 invoked by uid 500); 25 Apr 2007 14:08:26 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 28538 invoked by uid 500); 25 Apr 2007 14:08:26 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 28527 invoked by uid 99); 25 Apr 2007 14:08:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2007 07:08:26 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of glen.vermeylen@gmail.com designates 209.85.132.247 as permitted sender) Received: from [209.85.132.247] (HELO an-out-0708.google.com) (209.85.132.247) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2007 07:08:18 -0700 Received: by an-out-0708.google.com with SMTP id d31so74449and for ; Wed, 25 Apr 2007 07:07:58 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ODztJr/0+AoCnmoJ4zRvW7+iQ8OJELexygmdKQV11RY2UYHjUMfVBxoqYRxMBLA4SHZIVc5eUCWKCen4d5nUvEOmEJLiY5du4U7IwzpMDrHnNzpt123ydFMM5Np6L/QxowecV0R/85xxExtU5g0vosuz6mCbKnM+I2rfPWCV/20= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=JcFMVzu6IB+c9V5QLnFsEAieMMivshqakHaELa3a8VawTvIVY2WWD1Avyl7KfTgE0WbdlJGCtBPZ1sNA5bYA3RAgVI0n/D0T9+71Ql8WgSGjetU9thWQXdLo532p1QhNsyj6l0HQHEZW2xIiYeGir7yfTDP4vmWEahrjjZvK7yg= Received: by 10.100.178.7 with SMTP id a7mr189894anf.1177510077549; Wed, 25 Apr 2007 07:07:57 -0700 (PDT) Received: by 10.100.42.8 with HTTP; Wed, 25 Apr 2007 07:07:57 -0700 (PDT) Message-ID: Date: Wed, 25 Apr 2007 16:07:57 +0200 From: "Glen Vermeylen" To: "Tomcat Users List" Subject: Re: Can't create jdbc resource in context.xml In-Reply-To: <3ef28230704230900r67432a0bu97ec7e97c1881521@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_261675_8343854.1177510077145" References: <3ef28230704230900r67432a0bu97ec7e97c1881521@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_261675_8343854.1177510077145 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline It also doesn't work with the resource-ref element. The error was "" javax.naming.NameNotFoundException: Name jdbc is not bound in this Context"", but I was able to lookup the jdbc/sandwiches datasource using programmatic jndi lookup. Weird part is that everything works fine if I move the datasource element from the context file to server.xml. Is it possible that the realm gets initialized before the datasource or that something causes the realm to initialize in a different context where it doesn't have access to the datasource? Anyways, thank you very much for your help. I've found a solution which works but if there are some suggestions on how to get it to work using a datasourcerealm I will still try them out. Regards, Glen. 2007/4/23, Rashmi Rubdi : > > Hi Glen, > > I compared your configuration with the standard configuration > mentioned > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html > and found a few differences. > > Please see my replies to your post below: > > On 4/20/07, Glen Vermeylen wrote: > > Hello everybody, > > > > I'm trying to move a global jdbc resource out of server.xml so it is > > application specific. Following is the server.xml (which works fine) > ................................. > > > > What I did was remove the the and > elements > > from server.xml and put them inside > > $CATALINA_HOME/conf/Catalina/localhost/esandwich.xml (don't mind the > weird > > name :) ), but I keep getting the error > > "javax.naming.NameNotFoundException: Name jdbc is not bound in this > Context" > > > > esandwich.xml: > > > crosscontext="true"> > > crossContext attribute's case needs to be crossContext , but it is > specified as crosscontext. > > One question, though a little irrelevant is -- do you really need > crossContext="true" ? Just because it is specified in the sample on > the JDBC Datasource HowTo page, doesn't mean you would need it - this > is just a thought. If you don't need it, please set it to false or > remove the attribute. > > > > password="tomcat" type="javax.sql.DataSource" > > > url="jdbc:mysql://192.168.16.39:3306/sandwiches?autoReconnect=true" > > username="tomcat" /> > > > > > > > dataSourceName="jdbc/sandwiches" debug="99" roleNameCol="role" > > userCredCol="password" userNameCol="user" > userRoleTable="userroles" > > userTable="users" /> > > > > > > I believe the problem lies witht he element > > No the problem is in web.xml , I don't see any definition for: > > > > please see under "3. web.xml configuration" at > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html > for the details on web.xml entries. > > > because if only move > > the element to the esandwich.xml and leave the > > in server.xml everything > still > > works. We've been searching for a few hours now and can't find the > solution. > > Any help would be highly appreciated. > > > > web.xml: > > > > > xmlns="http://java.sun.com/xml/ns/j2ee" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> > > esandwich > > > > > > org.springframework.web.context.ContextLoaderListener > > > > > > > > dispatcher > > > > org.springframework.web.servlet.DispatcherServlet > > > > > > > > dispatcher > > /app/* > > > > > > index.jsp > > > > > > FORM > > > > /login.html > > /loginError.html > > > > > > > > > > > > default > > /app/* > > POST > > GET > > > > > > everyone can log in > > * > > > > > > > > > > The Only Secure Role > > admin > > > > > > > > > > > > Many thanks in advance, > > Glen. > > > > -Regards > Rashmi > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > ------=_Part_261675_8343854.1177510077145--