Re: DB Max Connections with Auto-Scaling Group

2021-06-22 Thread Christopher Schultz

Jerry,

On 6/21/21 14:54, Jerry Malcolm wrote:
I have a TC instance running on an EC2 in an AWS Autoscaling group.  I 
have a database with 500 max connections.  The default EC2 count is 2 
instances in the autoscaling group.  I guess that means that I should 
set the Tomcat resource config for this datasource to be maxTotal = 250, 
so if both instances max out we never exceed the 500 db max.  But sooner 
or later, the auto-scaling group is going to add a third and maybe a 
fourth instance at some crunch time, all still talking to the same 
database.  Now we have a maxTotal combined of 1000 connections talking 
to a database that can handle 500 which seems to be a recipe for 
disaster.  Yet I want to utilize all 500 available connections when I 
have one two EC2 instances running.


Is there something I can do inside TC to rebalance the maxTotal 
connections available to each TC instance as instances are added and 
removed?


Other suggestions?


You may be surprised at how few connections per node you can get away 
with. At $work, we usually have ~500 users per Tomcat node and they are 
each sharing a connection pool with maxTotal=20. Maybe you need more, 
but you might want to "work forward" from what you actually need on each 
node, rather than "working backward" from your database's limits.


Thanks,
-chris

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



RE: Request for suggestion

2021-06-22 Thread Mohan T
Hi



We are accessing the file as per the below url 
http://172.27.8.57:8081/hub/app/classic/security/Logon_ezelogin.json. In chrome 
browser.



The file Logon_ezelogin.json file is available in the path inside 
webapps\hub#app#classic#security.war



See the below deployed structure



Thanks



Mohan





[cid:image001.png@01D7678C.6CEA3650]

















-Original Message-
From: Mark Thomas 
Sent: 22 June 2021 16:27
To: users@tomcat.apache.org
Subject: Re: Request for suggestion



CAUTION: You received this email from external Domain. Check reliability of 
sender’s email ID. Do not click links, open attachments unless you recognize 
the sender and know the content is safe. – Ramco IMG







On 22/06/2021 11:43, Mohan T wrote:

> Hi,

>

> Thanks for the suggestion.

>

> We agree that .ear cannot be deployed on tomcat .

>

> Our requirement is as under

>

> 1.  We have deployed a binary as  below  in webapps 
> hub#app#classic#security.war



OK.



> 2.  The same is explored and  deployed as   hub#app#classic#security



OK. With the default settings the WAR will be unpacked to a directory for 
performance reasons.



> 3.  Now we are trying to access the file inside 
> /webapps/hub/app/classic/security/.



How, exactly, are you trying to access that file?



> 4.  The war file name is hub#app#classic#security.war



Same as point 1.



> 5.  and context path is hub/app/classic/security.



Strictly, the context path is:

/hub/app/classic/security



The leading "/" is important when you are working with paths in an application 
although I don't think it will be a factor here.



Mark





>

> Kindly suggest how to proceed

>

> Thanks

>

> Mohan

> -Original Message-

> From: Mark Thomas mailto:ma...@apache.org>>

> Sent: 22 June 2021 14:43

> To: users@tomcat.apache.org

> Subject: Re: Request for suggestion

>

> CAUTION: You received this email from external Domain. Check

> reliability of sender’s email ID. Do not click links, open attachments

> unless you recognize the sender and know the content is safe. – Ramco

> IMG

>

>

>

> On 22/06/2021 07:40, Mohan T wrote:

>> Hi,

>>

>> We are using tomcat 8.5.35 on RHEL.

>>

>> I  have a .ear file that has a application.xml file in meta-inf folder.  See 
>> below the contents  of the application.xml file .

>>

>>  > "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN"

>> "https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjav

>> a

>> .sun.com%2Fj2ee%2Fdtds%2Fapplication_1_2.dtddata=04%7C01%7CMohan.

>> T%40ramco.com%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4

>> d

>> 28a83d0d6e896%7C0%7C0%7C637599500050593410%7CUnknown%7CTWFpbGZsb3d8ey

>> J

>> WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100

>> 0

>> sdata=9cRF11EhNgwg%2FxPmbM0ybMUttNlsBz3iBhpmld7rNGM%3Dreser

>> v

>> ed=0">

>> 

>> Application WEB RVWJ

>> Application

>> adminWEB.war/hub/app/cl

>> a ssic/admin

>> auditWEB.war/hub/app/cl

>> a ssic/audit

>> deploymentWEB.war/hub/a

>> p p/classic/deployment

>> implementationWEB.war/h

>> u b/app/classic/implementation

>> securityWEB.war/hub/app

>> / classic/security

>> hubWEB.war/hub> -

>> root>

>> daemonWEB.war/hub/app/c

>> l assic/daemon

>> 

>>

>> In each .war file I have the contents of the component along with a web-inf 
>> folder and the web.xml file.  See sample contents of the file of audit 
>> component.

>>

>>  > "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

>> "https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjav

>> a

>> .sun.com%2Fdtd%2Fweb-app_2_3.dtddata=04%7C01%7CMohan.T%40ramco.c

>> o

>> m%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4d28a83d0d6e8

>> 9

>> 6%7C0%7C0%7C637599500050593410%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj

>> A

>> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=

>> I QDnroJTM2jmjKZECiOPyngjFYyEeWZs6FebcTGXgrs%3Dreserved=0">

>> > id="WebApp_ID">Auditweb.xml

>> for Audit component

>>

>> I am able to deploy individual .war files but the launch page is  not 
>> getting set .

>>

>> My launch page is

>>

>> http:\\localhost:8080\hub

>>

>> Kindly guide on how to deploy (Considering the launching page

>> mentioned above)

>

> You can't. Tomcat does not support EARs.

>

> Tomcat also ignores any ... in a WAR file.

> As per the Servlet spec, any such setting may be over-ridden by container 
> specific configuration and since Tomcat derives the context path from the 
> file name it always overrides any 

>

> The process Tomcat uses to determine the context path is documented at:

> https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftomca

> t.apache.org%2Ftomcat-8.5-doc%2Fconfig%2Fcontext.html%23Namingdat

> a=04%7C01%7CMohan.T%40ramco.com%7C930cf7339b3f4020a09708d9356c7e0a%7C7

> 5f8ca7fffca4bf8a4d28a83d0d6e896%7C0%7C0%7C637599562395780217%7CUnknown

> 

Re: Request for suggestion

2021-06-22 Thread Mark Thomas

On 22/06/2021 11:43, Mohan T wrote:

Hi,

Thanks for the suggestion.

We agree that .ear cannot be deployed on tomcat .

Our requirement is as under

1.  We have deployed a binary as  below  in webapps 
hub#app#classic#security.war


OK.


2.  The same is explored and  deployed as   hub#app#classic#security


OK. With the default settings the WAR will be unpacked to a directory 
for performance reasons.



3.  Now we are trying to access the file inside 
/webapps/hub/app/classic/security/.


How, exactly, are you trying to access that file?


4.  The war file name is hub#app#classic#security.war


Same as point 1.


5.  and context path is hub/app/classic/security.


Strictly, the context path is:
/hub/app/classic/security

The leading "/" is important when you are working with paths in an 
application although I don't think it will be a factor here.


Mark




Kindly suggest how to proceed

Thanks

Mohan
-Original Message-
From: Mark Thomas 
Sent: 22 June 2021 14:43
To: users@tomcat.apache.org
Subject: Re: Request for suggestion

CAUTION: You received this email from external Domain. Check reliability of 
sender’s email ID. Do not click links, open attachments unless you recognize 
the sender and know the content is safe. – Ramco IMG



On 22/06/2021 07:40, Mohan T wrote:

Hi,

We are using tomcat 8.5.35 on RHEL.

I  have a .ear file that has a application.xml file in meta-inf folder.  See 
below the contents  of the application.xml file .

 https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjava
.sun.com%2Fj2ee%2Fdtds%2Fapplication_1_2.dtddata=04%7C01%7CMohan.
T%40ramco.com%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4d
28a83d0d6e896%7C0%7C0%7C637599500050593410%7CUnknown%7CTWFpbGZsb3d8eyJ
WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000
sdata=9cRF11EhNgwg%2FxPmbM0ybMUttNlsBz3iBhpmld7rNGM%3Dreserv
ed=0">

Application WEB RVWJ
Application
adminWEB.war/hub/app/cla
ssic/admin
auditWEB.war/hub/app/cla
ssic/audit
deploymentWEB.war/hub/ap
p/classic/deployment
implementationWEB.war/hu
b/app/classic/implementation
securityWEB.war/hub/app/
classic/security
hubWEB.war/hub
daemonWEB.war/hub/app/cl
assic/daemon


In each .war file I have the contents of the component along with a web-inf 
folder and the web.xml file.  See sample contents of the file of audit 
component.

 https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjava
.sun.com%2Fdtd%2Fweb-app_2_3.dtddata=04%7C01%7CMohan.T%40ramco.co
m%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4d28a83d0d6e89
6%7C0%7C0%7C637599500050593410%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=I
QDnroJTM2jmjKZECiOPyngjFYyEeWZs6FebcTGXgrs%3Dreserved=0">
Auditweb.xml
for Audit component

I am able to deploy individual .war files but the launch page is  not getting 
set .

My launch page is

http:\\localhost:8080\hub

Kindly guide on how to deploy (Considering the launching page
mentioned above)


You can't. Tomcat does not support EARs.

Tomcat also ignores any ... in a WAR file.
As per the Servlet spec, any such setting may be over-ridden by container specific 
configuration and since Tomcat derives the context path from the file name it always 
overrides any 

The process Tomcat uses to determine the context path is documented at:
https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftomcat.apache.org%2Ftomcat-8.5-doc%2Fconfig%2Fcontext.html%23Namingdata=04%7C01%7CMohan.T%40ramco.com%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4d28a83d0d6e896%7C0%7C0%7C637599500050603370%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=pgn6NvFIiU7tg2X6UTVfsqPCLyMg8xa9JE24ecnNUNI%3Dreserved=0

Mark

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

DISCLAIMER: This communication contains information which is confidential and 
the copyright of Ramco Systems Ltd, its subsidiaries or a third party 
(“Ramco”). This email may also contain legally privileged information. 
Confidentiality and legal privilege attached to this communication are not 
waived or lost by reason of mistaken delivery to you.This email is intended to 
be read or used by the addressee only. If you are not the intended recipient, 
any use, distribution, disclosure or copying of this email is strictly 
prohibited without the express written approval of Ramco. Please delete and 
destroy all copies and email Ramco at le...@ramco.com immediately. Any views 
expressed in this communication are those of the individual sender, except 
where the sender specifically states them to be the views of Ramco. Except as 
required by law, Ramco does not represent, warrant and/or guarantee that the 
integrity of this communication has been maintained nor that the communication 

RE: Request for suggestion

2021-06-22 Thread Mohan T
Hi,

Thanks for the suggestion.

We agree that .ear cannot be deployed on tomcat .

Our requirement is as under

1.  We have deployed a binary as  below  in webapps 
hub#app#classic#security.war.
2.  The same is explored and  deployed as   hub#app#classic#security.
3.  Now we are trying to access the file inside 
/webapps/hub/app/classic/security/.
4.  The war file name is hub#app#classic#security.war
5.  and context path is hub/app/classic/security.

Kindly suggest how to proceed

Thanks

Mohan
-Original Message-
From: Mark Thomas 
Sent: 22 June 2021 14:43
To: users@tomcat.apache.org
Subject: Re: Request for suggestion

CAUTION: You received this email from external Domain. Check reliability of 
sender’s email ID. Do not click links, open attachments unless you recognize 
the sender and know the content is safe. – Ramco IMG



On 22/06/2021 07:40, Mohan T wrote:
> Hi,
>
> We are using tomcat 8.5.35 on RHEL.
>
> I  have a .ear file that has a application.xml file in meta-inf folder.  See 
> below the contents  of the application.xml file .
>
>   "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN"
> "https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjava
> .sun.com%2Fj2ee%2Fdtds%2Fapplication_1_2.dtddata=04%7C01%7CMohan.
> T%40ramco.com%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4d
> 28a83d0d6e896%7C0%7C0%7C637599500050593410%7CUnknown%7CTWFpbGZsb3d8eyJ
> WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000
> sdata=9cRF11EhNgwg%2FxPmbM0ybMUttNlsBz3iBhpmld7rNGM%3Dreserv
> ed=0">
> 
> Application WEB RVWJ
> Application
> adminWEB.war/hub/app/cla
> ssic/admin
> auditWEB.war/hub/app/cla
> ssic/audit
> deploymentWEB.war/hub/ap
> p/classic/deployment
> implementationWEB.war/hu
> b/app/classic/implementation
> securityWEB.war/hub/app/
> classic/security
> hubWEB.war/hub root>
> daemonWEB.war/hub/app/cl
> assic/daemon
> 
>
> In each .war file I have the contents of the component along with a web-inf 
> folder and the web.xml file.  See sample contents of the file of audit 
> component.
>
>   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjava
> .sun.com%2Fdtd%2Fweb-app_2_3.dtddata=04%7C01%7CMohan.T%40ramco.co
> m%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4d28a83d0d6e89
> 6%7C0%7C0%7C637599500050593410%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=I
> QDnroJTM2jmjKZECiOPyngjFYyEeWZs6FebcTGXgrs%3Dreserved=0">
>  id="WebApp_ID">Auditweb.xml
> for Audit component
>
> I am able to deploy individual .war files but the launch page is  not getting 
> set .
>
> My launch page is
>
> http:\\localhost:8080\hub
>
> Kindly guide on how to deploy (Considering the launching page
> mentioned above)

You can't. Tomcat does not support EARs.

Tomcat also ignores any ... in a WAR file.
As per the Servlet spec, any such setting may be over-ridden by container 
specific configuration and since Tomcat derives the context path from the file 
name it always overrides any 

The process Tomcat uses to determine the context path is documented at:
https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftomcat.apache.org%2Ftomcat-8.5-doc%2Fconfig%2Fcontext.html%23Namingdata=04%7C01%7CMohan.T%40ramco.com%7C6b7c563128f94d814b3e08d9355dfcb1%7C75f8ca7fffca4bf8a4d28a83d0d6e896%7C0%7C0%7C637599500050603370%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=pgn6NvFIiU7tg2X6UTVfsqPCLyMg8xa9JE24ecnNUNI%3Dreserved=0

Mark

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

DISCLAIMER: This communication contains information which is confidential and 
the copyright of Ramco Systems Ltd, its subsidiaries or a third party 
(“Ramco”). This email may also contain legally privileged information. 
Confidentiality and legal privilege attached to this communication are not 
waived or lost by reason of mistaken delivery to you.This email is intended to 
be read or used by the addressee only. If you are not the intended recipient, 
any use, distribution, disclosure or copying of this email is strictly 
prohibited without the express written approval of Ramco. Please delete and 
destroy all copies and email Ramco at le...@ramco.com immediately. Any views 
expressed in this communication are those of the individual sender, except 
where the sender specifically states them to be the views of Ramco. Except as 
required by law, Ramco does not represent, warrant and/or guarantee that the 
integrity of this communication has been maintained nor that the communication 
is free of errors, virus, interception or interference. If you do not wish to 
receive such communications, please forward this communication to 
market...@ramco.com and express 

Re: Request for suggestion

2021-06-22 Thread Mark Thomas

On 22/06/2021 07:40, Mohan T wrote:

Hi,

We are using tomcat 8.5.35 on RHEL.

I  have a .ear file that has a application.xml file in meta-inf folder.  See 
below the contents  of the application.xml file .


http://java.sun.com/j2ee/dtds/application_1_2.dtd;>

Application WEB
RVWJ Application
adminWEB.war/hub/app/classic/admin
auditWEB.war/hub/app/classic/audit
deploymentWEB.war/hub/app/classic/deployment
implementationWEB.war/hub/app/classic/implementation
securityWEB.war/hub/app/classic/security
hubWEB.war/hub
daemonWEB.war/hub/app/classic/daemon


In each .war file I have the contents of the component along with a web-inf 
folder and the web.xml file.  See sample contents of the file of audit 
component.


http://java.sun.com/dtd/web-app_2_3.dtd;>
Auditweb.xml for Audit 
component

I am able to deploy individual .war files but the launch page is  not getting 
set .

My launch page is

http:\\localhost:8080\hub

Kindly guide on how to deploy (Considering the launching page mentioned above)


You can't. Tomcat does not support EARs.

Tomcat also ignores any ... in a WAR file. 
As per the Servlet spec, any such setting may be over-ridden by 
container specific configuration and since Tomcat derives the context 
path from the file name it always overrides any 



The process Tomcat uses to determine the context path is documented at:
http://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming

Mark

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



R: Subclassing JNDIRealm to return a custom Principal

2021-06-22 Thread Roberto Benedetti
I was aware of your PR and it's good news.

Our Principal implementation differs from the PR:
 - attribute values are strings and some specific conversion are performed 
(e.g. converting objectGUID to canonical UUID)
 - has other fields/methods we use for OAuth (JASPIC) authentication

I think that some refactoring could make it easier to subclass Tomcat realms to 
return a custom Principal.

-Messaggio originale-
Da: Carsten Klein  
Inviato: lunedì 21 giugno 2021 19:37
A: users@tomcat.apache.org
Oggetto: Re: Subclassing JNDIRealm to return a custom Principal


Roberto,

On 21.06.2021 18:31, Roberto Benedetti wrote:
> Hello,
> in our product we subclassed JNDIRealm to return a custom Principal with 
> attributes retrieved from Active Directory (bug 65391 is going to add support 
> for that).
> We overrode authenticate(DirContext, String, String) to retrieve the 
> attributes and return the custom Principal.
> In Tomcat 9.0.39 the method has changed to authenticate(JNDIConnection, 
> String, String) and we cannot override it to retrieve the attributes because 
> JNDIConnection.context is not visible to subclasses.
> Is there a work-around for that?


Couldn't that new feature be an alternative for running your own implementation 
of the JNDIRealm?

https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Ftomcat%2Fpull%2F428data=04%7C01%7Croberto.benedetti%40dedalus.eu%7C75de31b2d3dd4e0ef4ff08d934db3436%7C95c3bdfa4a9db595ff68329945ef%7C0%7C0%7C637598938341356824%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=GivsLeZtrxqqEAdzokvlOrppKRvAam%2BoXYrCKlfHYB4%3Dreserved=0

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


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



Request for suggestion

2021-06-22 Thread Mohan T
Hi,

We are using tomcat 8.5.35 on RHEL.

I  have a .ear file that has a application.xml file in meta-inf folder.  See 
below the contents  of the application.xml file .


http://java.sun.com/j2ee/dtds/application_1_2.dtd;>

Application WEB
RVWJ Application
adminWEB.war/hub/app/classic/admin
auditWEB.war/hub/app/classic/audit
deploymentWEB.war/hub/app/classic/deployment
implementationWEB.war/hub/app/classic/implementation
securityWEB.war/hub/app/classic/security
hubWEB.war/hub
daemonWEB.war/hub/app/classic/daemon


In each .war file I have the contents of the component along with a web-inf 
folder and the web.xml file.  See sample contents of the file of audit 
component.


http://java.sun.com/dtd/web-app_2_3.dtd;>
Auditweb.xml 
for Audit component

I am able to deploy individual .war files but the launch page is  not getting 
set .

My launch page is

http:\\localhost:8080\hub

Kindly guide on how to deploy (Considering the launching page mentioned above)

Thanks

Mohan

DISCLAIMER: This communication contains information which is confidential and 
the copyright of Ramco Systems Ltd, its subsidiaries or a third party 
("Ramco"). This email may also contain legally privileged information. 
Confidentiality and legal privilege attached to this communication are not 
waived or lost by reason of mistaken delivery to you.This email is intended to 
be read or used by the addressee only. If you are not the intended recipient, 
any use, distribution, disclosure or copying of this email is strictly 
prohibited without the express written approval of Ramco. Please delete and 
destroy all copies and email Ramco at le...@ramco.com immediately. Any views 
expressed in this communication are those of the individual sender, except 
where the sender specifically states them to be the views of Ramco. Except as 
required by law, Ramco does not represent, warrant and/or guarantee that the 
integrity of this communication has been maintained nor that the communication 
is free of errors, virus, interception or interference. If you do not wish to 
receive such communications, please forward this communication to 
market...@ramco.com and express your wish not to receive such communications 
henceforth.