Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 95038 invoked from network); 8 Feb 2005 16:14:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Feb 2005 16:14:08 -0000 Received: (qmail 31204 invoked by uid 500); 8 Feb 2005 16:13:49 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 31186 invoked by uid 500); 8 Feb 2005 16:13:48 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 31173 invoked by uid 99); 8 Feb 2005 16:13:48 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of omar.adobati@gmail.com designates 64.233.170.199 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.199) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 08 Feb 2005 08:13:47 -0800 Received: by rproxy.gmail.com with SMTP id z35so909219rne for ; Tue, 08 Feb 2005 08:13:45 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=f+WlrFgauonVhf4OfBgzcYbECgYI01FPFjLn5JsvyHRGYgvH0C18IKHn3o9ToR393hC+2mpkez6468XdR6CmtuRL2/8roYmVO1ufhqTdJC6fRCQnXf6uYlWZ/MLeXNiGA+faCHJ9gI4FQgZMlzsWLvzXwDPjOi5y9U/PV9A3Lls= Received: by 10.38.92.44 with SMTP id p44mr169463rnb; Tue, 08 Feb 2005 08:13:45 -0800 (PST) Received: by 10.38.209.12 with HTTP; Tue, 8 Feb 2005 08:13:44 -0800 (PST) Message-ID: <1f0f45f20502080813402c17ce@mail.gmail.com> Date: Tue, 8 Feb 2005 17:13:44 +0100 From: Omar Adobati Reply-To: Omar Adobati To: Tomcat Users List Subject: Re: [SOLVED] Form Auth + xml users database In-Reply-To: <1f0f45f205020700575f603d23@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1f0f45f205020609165b9fa58a@mail.gmail.com> <420659DC.1070100@eduhi.at> <1f0f45f205020611004ecbb0fb@mail.gmail.com> <1f0f45f2050206120531db7f2f@mail.gmail.com> <42068A51.6030606@eduhi.at> <1f0f45f205020700575f603d23@mail.gmail.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N nobody can help me? On Mon, 7 Feb 2005 09:57:32 +0100, Omar Adobati wrote: > Thx for ur answers, I have reied what you say about the second > question, but it's do not work. This is how I have changed my > "context.xml" file: > === > > workDir="work\Catalina\photoalbum\" path="/" cacheTTL="0" > cachingAllowed="false" displayName="bannerEmbedded beta" docBase="." > cacheMaxSize="0" reloadable="true"> > resourceName="PhotoAlbum"/> > directory="logs/photoalbum/" fileDateFormat="yyyy-MM-dd" suffix=".txt" > prefix="photoalbum_access_log."/> > > name="PhotoAlbum"/> > > > factory > org.apache.catalina.users.MemoryUserDatabaseFactory > > > pathname > conf/Catalina/photoalbum.localhost/photoalbum-users.xml > > > > === > > I have removed the ResourceParams from the server.xml file and move it > into the context.xml but in the log I can read this errors messages: > 1) javax.naming.NameNotFoundException: Name PhotoAlbum is not bound in > this Context > 2) GRAVE: Catalina.start: > LifecycleException: No UserDatabase component found under key PhotoAlbum > 3) 2005-02-07 09:55:30 UserDatabaseRealm[photoalbum.localhost]: > Exception looking up UserDatabase under key PhotoAlbum > javax.naming.NameNotFoundException: Name PhotoAlbum is not bound in this Context > > do u know why? I have I have give you all the elements you need to help me. > > On Sun, 06 Feb 2005 22:21:21 +0100, Mario Winterer > wrote: > > Hi! > > > > I'm happy you could solve your problem now! Seems the reason was the > > missing Realm-definition in your context.xml. > > > > To Question 1) > > Tomcat offers a separate JNDI-namespace for each web application (so if > > you have 4 web applications you will have 4 namespaces). These > > namespaces are configured in the -elements of the corresponsing > > web-applications. To define resources, you have to nest a > > -element in your -element (which should be in > > context.xml). > > A resource that is defined in the namespace of a web application cannot > > be seen by other web applications (because the namespaces are separated > > from each other). > > Sometimes, a resource may be required by more than one web application. > > To avoid configuring this resource several times - once per context - > > tomcat offers another namespace that is global and exists only once per > > tomcat instance. If you define a resource there, you can use it in each > > web application, that is allowed to use it. > > So how can you allow a web application to use a global resource? Simply > > "link" the global resource into the local JNDI-namespace of the > > web-application! This can be done by nesting a element in > > the element of the web-application that should be allowed to > > use the resource. When defining a -element, you must > > specify, which global resource you want to link into the namespace > > (attribut "global"), which type the resource is that you want to link > > (attribut "type"), and which name it should have in the local namespace > > (attribut "name") - this name can be equal to the global name. > > > > So the server.xml and context.xml hierarchy could look like the > > following (sorry for the "text-art" - use a fixed width font for "best > > results"): > > > > +- Server > > | > > +- GlobalNamingResources > > | +- Resource GlobResA > > | +- Resource GlobResB > > | > > +- Service > > +- Engine > > +- Realm X > > +- Host www.A.org > > | +- Context /A1 (defined in context.xml) > > | | +- ResourceLink to GlobResA, name: LocResA > > | | > > | +- Context /A2 (defined in context.xml) > > | | +- ResourceLink to GlobResA, name: LocResA > > | | +- ResourceLink to GlobResB, name: LocResB > > | | > > | +- Context /A3 (defined in context.xml) > > | +- Resource, name LocalResA > > | > > +- Host www.B.org > > +- Context /B1 > > | +- ResourceLink to GlobResA, name: LocResA > > | > > +- Context /B2 > > +- ResourceLink to GlobResB, name: LocResB > > > > Question 2) If you do not want to change server.xml (e.g. because you > > want to deploy your application to a foreign server and you cannot > > modify server.xml there), you could define a local JNDI-Resource in the > > -element of your web-application instead of the > > GlobalNamingResource (simply move the resource-definition from > > into your -element). If you do this, of > > course you do not need the any more! > > So you do not have to touch server.xml because all configurations can be > > done inside context.xml which is in the meta-inf directory of your web > > application. > > > > I hope, my explanations where understandable! > > > > Best regards, > > Tex > > > > > > Omar Adobati wrote: > > > > >changes in server.xml: > > >=== > > > > > > > > > > >name="PhotoAlbum"/> > > > > > > > > > factory > > > org.apache.catalina.users.MemoryUserDatabaseFactory > > > > > > > > > pathname > > > conf/Catalina/photoalbum.localhost/photoalbum-users.xml > > > > > > > > > > > > > > >=== > > > > > >changes in [context].xml > > >=== > > > > > > > >workDir="work\Catalina\photoalbum\" path="/" cacheTTL="0" > > >cachingAllowed="false" displayName="bannerEmbedded beta" docBase="." > > >cacheMaxSize="0" reloadable="true"> > > > > >resourceName="PhotoAlbum"/> > > > > >directory="logs/photoalbum/" fileDateFormat="yyyy-MM-dd" suffix=".txt" > > >prefix="photoalbum_access_log."/> > > > > >type="org.apache.catalina.UserDatabase"/> > > > > > >=== > > > > > >Question 1) > > >Also if I've red the tomcat site docs I cant understand so good what > > >ResourceLink does. Does anyone can explain me? > > > > > >Question 2) > > >Using this approach I have changed the server.xml manually. So, if I > > >need/want to deploy my own webapp using a war file, which approach I > > >have to use? > > > > > >(I'm sorry fot my bad english...) > > > > > >On Sun, 6 Feb 2005 20:00:04 +0100, Omar Adobati wrote: > > > > > > > > >>>But did you "connect" the UserDatabase > > >>>with the web-application by specifying a realm in your context? > > >>>(context.xml or server.xml) > > >>> > > >>> > > >>How can I set the Realm in my Context to specity an xml database? > > >>(maybe this is the main problem because it actually not exist) > > >> > > >> > > >> > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > > > > -- > Adobati Omar > omar.adobati@gmail.com > -- Adobati Omar omar.adobati@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org