Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 86310 invoked from network); 29 Jan 2007 16:11:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2007 16:11:37 -0000 Received: (qmail 25141 invoked by uid 500); 29 Jan 2007 16:11:28 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 25118 invoked by uid 500); 29 Jan 2007 16:11:28 -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 25107 invoked by uid 99); 29 Jan 2007 16:11:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 08:11:28 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of dns4@cornell.edu designates 128.253.83.141 as permitted sender) Received: from [128.253.83.141] (HELO authusersmtp.mail.cornell.edu) (128.253.83.141) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 08:11:19 -0800 Received: from [128.253.38.248] (dns4-comstock2132-a2-netopsxp2.ento.cornell.edu [128.253.38.248]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.13.1/8.12.10) with ESMTP id l0TGAxPI013090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 29 Jan 2007 11:10:59 -0500 (EST) Message-ID: <45BE1C93.2070801@cornell.edu> Date: Mon, 29 Jan 2007 11:10:59 -0500 From: David Smith User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: datasource-realm troubles References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I would guess from the outset that your "Context.xml" file isn't being used. Where are your putting it and what are you naming it? What's the name of your webapp when deployed? Quick checks: 1. It has to be named to match your webapp if your are storing it in Catalina/localhost and deploying an expanded webapp. If the webapp is named fubar, then the file should be named fubar.xml. 2. If deploying a .war file, it has to be named context.xml (note: case is important) and stored in the war files META-INF directory. --David Walter, Oliver (BR/ICI3) wrote: >Hello, > >i have some trouble using a datasource realm in tomcat 5.5.20, jdk >1.5.0_09. > >In META-INF/Context.xml i defined a datasource: > > type="javax.sql.DataSource" maxActive="10" maxIdle="2" >maxWait="10000" > username="" password="" > driverClassName="com.mysql.jdbc.Driver" > >url="jdbc:mysql://localhost:3306/realmd?autoReconnect=true" /> > >and in web.xml a resource reference: > > > DB Connection > jdbc/mangos > javax.sql.DataSource > Container > > >With hibernate everything works fine, no problems, but if i define a >datasource realm in Context.xml > > dataSourceName="jdbc/mangos" > userTable=... /> > >it can`t find the resource name: > >javax.naming.NameNotFoundException: Name jdbc is not bound in this >Context > at >org.apache.naming.NamingContext.lookup(NamingContext.java:769) > at >org.apache.naming.NamingContext.lookup(NamingContext.java:152) > at >org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) > at >org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.j >ava:282) > ... > >I tried already the following namings, jdbc/mangos, >java:comp/env/jdbc/mangos, mangos, java:/comp/env/jdbc/mangos >with no luck. > >I can workaround this issue, when defining the resource in server.xml > >and create a type="javax.sql.DataSource" /> >in Context.xml, but i would prefer, doing Realm and Datasource >definition together in Context.xml. > > >The second issue i run into is programming my webapp against the realm >interface. I want to built >up the Navigation Panel dynamically based on the users asigned roles, >but when i try to access >GenericPrincipal i get "java.lang.NoClassDefFoundError: >org/apache/catalina/realm/GenericPrincipal". > >I also can workaround this issue by copying the catalina into my >webapp`s classpath (WEB-INF/lib/), >but i`m pretty this is not correct. > >I would be appreciate for any help. > >Regards Oliver > > > > > >--------------------------------------------------------------------- >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 > > > --------------------------------------------------------------------- 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