You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Josh Gooding <jo...@gmail.com> on 2012/09/29 23:41:24 UTC

Question on realm configuration in TC 6 / 7

It seems that I have run into something that seems a bit strange.  I have
configured 4 separate web applications to each have their own context.xml
files.  I have also configured one of the web applications to have a
realm.  It seems to me, when you configure a realm, tomcat forces you to
put what ever jdbc driver jar that you need, to be put into the
$CATALINA_HOME/lib directory?  If this is not how it works, then I'm
missing some piece of configuration knowledge.  If it is, isn't it a bit
counter intuitive in keeping each individual applications jars in the
context's own WEB-INF/lib folder?

I'm curious about how this is supposed to work.

- Josh

Re: Question on realm configuration in TC 6 / 7

Posted by Daniel Mikusa <dm...@vmware.com>.
On Sep 29, 2012, at 5:41 PM, Josh Gooding wrote:

> It seems that I have run into something that seems a bit strange.  I have
> configured 4 separate web applications to each have their own context.xml
> files.  

There are multiple places where you can put context configuration.  Where did you configure this?

  - conf/context.xml
  - META-INF/context.xml
  - conf/Catalina/localhost/<app-name>.xml
  - conf/server.xml

> I have also configured one of the web applications to have a
> realm.  

Again, where did you configure this?  context.xml? server.xml?

A brief example of what you are doing would be helpful for us to understand the issue.  Include your configuration, just remove any xml comments.

Dan


> It seems to me, when you configure a realm, tomcat forces you to
> put what ever jdbc driver jar that you need, to be put into the
> $CATALINA_HOME/lib directory?  If this is not how it works, then I'm
> missing some piece of configuration knowledge.  If it is, isn't it a bit
> counter intuitive in keeping each individual applications jars in the
> context's own WEB-INF/lib folder?
> 
> I'm curious about how this is supposed to work.
> 
> - Josh


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Question on realm configuration in TC 6 / 7

Posted by Josh Gooding <jo...@gmail.com>.
Daniel,

I have deployed the context.xml to the META-INF location per web
application, in the server.xml files I have set the copyXML attribute on
the <Host> declaration to true.  I do not configure context's anywhere but
there.

- Josh

On Mon, Oct 1, 2012 at 10:46 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Josh,
>
> On 9/29/12 5:41 PM, Josh Gooding wrote:
> > It seems that I have run into something that seems a bit strange.
> > I have configured 4 separate web applications to each have their
> > own context.xml files.  I have also configured one of the web
> > applications to have a realm.  It seems to me, when you configure a
> > realm, tomcat forces you to put what ever jdbc driver jar that you
> > need, to be put into the $CATALINA_HOME/lib directory?  If this is
> > not how it works, then I'm missing some piece of configuration
> > knowledge.  If it is, isn't it a bit counter intuitive in keeping
> > each individual applications jars in the context's own WEB-INF/lib
> > folder?
>
> That has been my experience when configuring the Realm from within the
> <Context>. IMO, the context should have its resources resolved using
> the WebappClassLoader for that context, but there is a bit of a
> chicken-in-an-egg situation with reading the context deployment
> descriptor which can configure the ClassLoaders.
>
> > I'm curious about how this is supposed to work.
>
> This is a situation not covered by the servlet spec, so "how it is
> supposed to work" is whatever the Tomcat devs decide, and can change
> over time.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBprLYACgkQ9CaO5/Lv0PBUoACfd7MJv91JugFAXPbg405GgHAf
> oEQAoJjV1t4bRcCmj6wUzh2oJAvVZDtf
> =Mi5d
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Question on realm configuration in TC 6 / 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Josh,

On 9/29/12 5:41 PM, Josh Gooding wrote:
> It seems that I have run into something that seems a bit strange.
> I have configured 4 separate web applications to each have their
> own context.xml files.  I have also configured one of the web
> applications to have a realm.  It seems to me, when you configure a
> realm, tomcat forces you to put what ever jdbc driver jar that you
> need, to be put into the $CATALINA_HOME/lib directory?  If this is
> not how it works, then I'm missing some piece of configuration
> knowledge.  If it is, isn't it a bit counter intuitive in keeping
> each individual applications jars in the context's own WEB-INF/lib
> folder?

That has been my experience when configuring the Realm from within the
<Context>. IMO, the context should have its resources resolved using
the WebappClassLoader for that context, but there is a bit of a
chicken-in-an-egg situation with reading the context deployment
descriptor which can configure the ClassLoaders.

> I'm curious about how this is supposed to work.

This is a situation not covered by the servlet spec, so "how it is
supposed to work" is whatever the Tomcat devs decide, and can change
over time.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBprLYACgkQ9CaO5/Lv0PBUoACfd7MJv91JugFAXPbg405GgHAf
oEQAoJjV1t4bRcCmj6wUzh2oJAvVZDtf
=Mi5d
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org