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



Re: Load balancing websockets

2021-08-01 Thread Christopher Schultz

Sridar,

On 7/28/21 20:16, Sridhar Rao wrote:

We are using the tomcat8.5 app nodes behind an Nginx Load Balancer.
Whenever the LB takes out an app node from the pool, "existing" WebSocket
connections are still staying with the app node. Also, if a new app node is
added to the pool, WS connections are not load balanced as they are
persistent. In general, wondering what are some of the mechanisms/tools are
employed to handle WebSocket load balancing issues.


Websocket is a connection-oriented protocol negotiated through a 
connectionless protocol (HTTP), and you end up with a persistent 
connection from client to server. Compare this to the (very!) old style 
of connecting a telephone call between two distant callers by making a 
series of physical connections such that you have one continuous circuit 
between the caller and the receiver. (That was before switching was 
introduced.)


Anyhow, once the connection has been established, what you describe is 
expected behavior: only HTTP can be load-balanced. Once the Websocket 
connection has been established, there is no way to "migrate" the 
connection to another node.


What you *can* do is terminate the connection and establish a new one, 
which will indeed be load-balanced as you expect.


Note that this may be awkward for your application.

One of the easiest possible things to do would be to implement a 
timed-termination of the connection on the client and/or the server so 
that Webocket connections never last more than e.g. 1 minute so your 
load-balancing becomes effective again.


Another possibility would be to think about why you are using Websocket 
in a way that would *require* load-balancing.


-chris

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



Re: Ho to upgrade to newest version in tomcat 9

2021-08-01 Thread Christopher Schultz

W,

On 7/28/21 04:08, Olaf Kock wrote:


On 27.07.21 19:01, W wrote:

Hi,
I am on Ubuntu with tomcat 9.0.16I tried    sudo apt-get update    sudo apt-get 
upgradeBut did not work. How to do it?


The distribution packages (here: Debian) typically pick one version and
keep it stable, optionally backporting security fixes to it. Odds are
that you're already not running the same code as in stock 9.0.16, but a
patched version.


+1

In order to get the latest Tomcat, you may have to switch your Ubuntu 
repository to point to the latest Ubuntu, then upgrade the whole distro 
which will include the latest Tomcat available.


If you want to be on the latest version as soon as it's out, you'll 
either have to install manually from https://tomcat.apache.org, or

find a repository that you trust, that offers a packaged version.

+1 again

You might be able to cobble-together a sources.list file that merges the 
latest Tomcat package (and maybe some dependencies) but allows the OS to 
otherwise remain at the older level, but I'd recommend upgrading the 
whole OS in general, even if you stop using the package-managed version 
of Tomcat.


-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


Re: Updating Oracle JDK or JRE from 1.8.0-1.8.0_291 to 1.8.0-1.8.0_301, Breaks Apache Tomcat 9 Connector Http11AprProtocol

2021-08-01 Thread Michael Osipov

https://bugs.openjdk.java.net/browse/JDK-8202837
https://www.oracle.com/java/technologies/javase/8u301-bugfixes.html

What now?

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