Re: JDBCRealm driver location 9.0.24

2021-08-01 Thread passignat
Thanks a lot, it works great. Driver is loaded from catalina_base now.



-Original Message-
From: Christopher Schultz 
Reply-To: Tomcat Users List 
To: users@tomcat.apache.org
Subject: Re: JDBCRealm driver location 9.0.24
Date: Sun, 1 Aug 2021 18:08:16 -0400

Stephane,
On 8/1/21 11:17, Stephane wrote:
> I'm trying to distinguish catalina_home from catalina_base and I use
> aJDBCRealm and soon will probably use other realms.

Don't use JDBCRealm. Instead, use DataSourceRealm. It's a long story,
but DataSourceRealm is what you want for production and JDBCRealm is
more of a toy.
They are configured very similarly.
> I read the documentation, mentioning JDBC driver needs to be
> incatalina_home/lib. I don't understand why as
> catalina.propertiesspecify common.loaderas
> "${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home
> }/lib","${catalina.base}/lib/*.jar"
 > > Can someone explain ?
common.loader includes both catalina.base/lib/*.jar and
catalina.home/lib/*.jar, so it doesn't matter whether you put it in
one place of the other.
I prefer using catalina.base for *everything* because it means that
your catalina.home is never polluted with stuff that didn't come from
the original tarball. The only changes I ever make to the extracted-
contents of the tarball are to sometimes change some file permissions.
My recommendation would be to put your JDBC driver library in
catalina.base/lib
> I also tried to modify catalina.properties (to test
> withserver.loader) but as soon as I have the file in catalina_base
> (evenempty), the server doesn't start at
> all(java.lang.ClassNotFoundException:org.apache.catalina.startup.Cat
> alina).
> Can someone help on this too ?

Do you have the library in multiple places?
I wouldn't mess-around with catalina.properties unless you absolutely
have to. Every default in there makes a *LOT* of sense.
Hope that helps,-chris
---
--To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




Re: JDBCRealm driver location 9.0.24

2021-08-01 Thread Christopher Schultz

Stephane,

On 8/1/21 11:17, Stephane wrote:

I'm trying to distinguish catalina_home from catalina_base and I use a
JDBCRealm and soon will probably use other realms.


Don't use JDBCRealm. Instead, use DataSourceRealm. It's a long story, 
but DataSourceRealm is what you want for production and JDBCRealm is 
more of a toy.


They are configured very similarly.


I read the documentation, mentioning JDBC driver needs to be in
catalina_home/lib. I don't understand why as catalina.properties
specify common.loader
as "${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.hom
e}/lib","${catalina.base}/lib/*.jar"

>
> Can someone explain ?

common.loader includes both catalina.base/lib/*.jar and 
catalina.home/lib/*.jar, so it doesn't matter whether you put it in one 
place of the other.


I prefer using catalina.base for *everything* because it means that your 
catalina.home is never polluted with stuff that didn't come from the 
original tarball. The only changes I ever make to the extracted-contents 
of the tarball are to sometimes change some file permissions.


My recommendation would be to put your JDBC driver library in 
catalina.base/lib



I also tried to modify catalina.properties (to test with
server.loader) but as soon as I have the file in catalina_base (even
empty), the server doesn't start at all
(java.lang.ClassNotFoundException:
org.apache.catalina.startup.Catalina).

Can someone help on this too ?


Do you have the library in multiple places?

I wouldn't mess-around with catalina.properties unless you absolutely 
have to. Every default in there makes a *LOT* of sense.


Hope that helps,
-chris

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



JDBCRealm driver location 9.0.24

2021-08-01 Thread Stephane
Hello,

I'm trying to distinguish catalina_home from catalina_base and I use a
JDBCRealm and soon will probably use other realms. 
I read the documentation, mentioning JDBC driver needs to be in
catalina_home/lib. I don't understand why as catalina.properties
specify common.loader
as "${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.hom
e}/lib","${catalina.base}/lib/*.jar"

Can someone explain ?

I also tried to modify catalina.properties (to test with
server.loader) but as soon as I have the file in catalina_base (even
empty), the server doesn't start at all
(java.lang.ClassNotFoundException:
org.apache.catalina.startup.Catalina).

Can someone help on this too ?


thanks
Stephane