Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.

2023-12-06 Thread Christopher Schultz

Sai Vamsi,

On 12/5/23 08:57, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote:

I have added my annotations in Catalina_opts ., and I am not able to see any 
Java Process with the JMX, neither the port is being listened.
It came back to previous stage where Annotations are not on the JVM .,
Came back to previous stage, where connection refused error.,  as follows.

Could not initialize instance: tomcat-10.75.12.136-49151:
java.util.concurrent.ExecutionException: java.io.IOException: Failed to 
retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root 
exception is java.rmi.ConnectException: Connection refused to host: 
10.75.12.136; nested exception is:
 java.net.ConnectException: Connection refused (Connection refused)]
 at 
java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
 at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
 at org.datadog.jmxfetch.App.processRecoveryResults(App.java:953)
 at org.datadog.jmxfetch.App$5.invoke(App.java:927)
 at 
org.datadog.jmxfetch.tasks.TaskProcessor.processTasks(TaskProcessor.java:63)
 at org.datadog.jmxfetch.App.init(App.java:917)
 at org.datadog.jmxfetch.App.start(App.java:413)
 at org.datadog.jmxfetch.App.run(App.java:173)
 at org.datadog.jmxfetch.JmxFetch.main(JmxFetch.java:57)
 at org.datadog.jmxfetch.App.main(App.java:91)


Right: the DataDog server is unable to connect to your appication via 
JMX. I'm assuming that 10.75.12.136 is the IP where Tomcat is running, 
and that DataDog isn't running on that server. It's on some other IP, right?


Here we were not able to find any process , to confirm that atleast 
port is being listened to.
What is your exact CATALINA_OPTS value (masking any secrets that may be 
in there).


Is Tomcat definitely running? Can you prove that with a "ps" listing, 
for example? That will also confirm it's running with the proper 
CATALINA_OPTS settings.


Can you run "netstat" and show all of the ports your Tomcat process is 
listening to?


I'm assuming that your Tomcat process is being hosted in some kind of 
container. Is the IP address 10.75.12.136 the IP of the container, or 
the IP of the host which hosts the container? Is your JMX port 
configured to be visible external to the container itself, or only 
internally to the container?


-chris




Thanks & Regards,
--

SAI VAMSI .B
Senior DevOps Engineer


From: Christopher Schultz 
Sent: Tuesday, December 5, 2023 19:19
To: users@tomcat.apache.org 
Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.

Sai Vamsa,

On 12/5/23 01:25, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote:

Thanks for the response..

as you suggested., I tried adding my annotations in CATALINA_OPTS., Instead of 
Java_Opts and Java_tool_options.,

But its not even working out., Java process is not getting created., and port 
is not bound to any process.
Let me know if I am missing anything.


Okay. Can you please summarize the current situation? I think you've
made a few changes, etc. so it would help to know the current state.

Stop Tomcat and any other related services, delete all appropriate log
files, etc. and start Tomcat (or attempt to). Then post any output that
is relevant, and if you get things like "address in use" then please
post the details about which process id owns that port and the full
command-line that launched that process.

Thanks,
-chris



From: Christopher Schultz 
Sent: Monday, December 4, 2023 23:22
To: users@tomcat.apache.org 
Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.

Sai Vamsi,

On 12/4/23 03:53, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote:

Firstly thanks for adding a point me in asking me to check, if the annotations 
are reflecting in the Java process, which opened me a door to add the concerned 
annotations in correct place., by adding in java_tool_options in stead of 
Java_opts.


You will probably want to use CATALINA_OPTS instead of any of the other
ones. JAVA_TOOL_OPTS isn't an environment variable regognized by Tomcat.
You certainly don't want to use JAVA_OPTS, because Tomcat uses JAVA_OPTS
any time it invokes a JVM. For example, running bind/digest.sh doesn't
need to have the JMX subsystem starting-up and trying to grab a port.

JAVA_TOOL_OPTS is an environment variable used by JVM-launching
processes, like jps for example...


yeah they are reflecting and creating a Java Process.
but I am facing a problem here., while i am checking JSP, Thats :  the port i 
am using here to enable JMX is been opening a process with the mentioned port 
and at the same time shows port is being used.:

root@lab1workflow4scalsvc2zus1-deployment-577d856494-ftb22:/# jps
Picked up JAVA_TOOL_OPTIONS: -Xms2048M -Xmx10240M -XX:+UseStringDeduplication 
-XX:+UseContainerSupport -Dcom.sun.management.jmxremote 
-Dcom.sun

Re: Thread Pool Question

2023-12-06 Thread Christopher Schultz

William,

On 12/5/23 14:39, William Crowell wrote:

I should clarify the ask here…

I have some long running JDBC queries against Oracle, and I do not
want to tie up Tomcat’s web thread pool with them.  I would only have
between 1-10 threads in this pool.


Executors aren't directly-accessible by applications. If you want to
off-load processing to another thread, you'll have to maintain your own 
thread-pool.


If you are using plain-old servlet dispatching, then off-loading to 
another thread won't save you anything: your request-processing thread 
will have to wait on your database-processing thread to complete before 
returning a response. It sounds like what you really want is 
servet-async where you put the request to sleep while you do something 
time-consuming and let the request-processing thread go back into the pool.


If you really are running the thread in the background, say, across 
requests, then you can do this with a thread pool that you, say, store 
in the application scope. I've done this myself, and end up storing a 
"progress object" in the user's session so that any subsequent request 
can check on the status of the long-running process.


-chris

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



Re: Looking for examples...

2023-12-06 Thread Christopher Schultz

Jon,

On 12/5/23 19:02, Mcalexander, Jon J. wrote:
I am trying to find decent examples for Property Replacements in 
Catalina.properties. I have an instance that is giving me the

following Warning and it bugs me:

Dec 05, 2023 5:48:51 PM org.apache.tomcat.util.digester.Digester 
replaceSystemProperties
WARNING: System property [common.loader] failed to update and remains 
["${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar"]


Is anything specifically not working, or are you just trying to get this 
warning to go away?



I've looked at the docs, and all I'm really finding is the following:


So... which property source are you actually using? Or are you using the 
default?


-chris

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



Re: Looking for examples...

2023-12-06 Thread Chuck Caldarale


> On Dec 5, 2023, at 18:02, Mcalexander, Jon J. 
>  wrote:
> 
> I am trying to find decent examples for Proerty Replacements in 
> Catalina.properties. I have an instance that is giving me the following 
> Warning and it bugs me:
> 
> Dec 05, 2023 5:48:51 PM org.apache.tomcat.util.digester.Digester 
> replaceSystemProperties
> WARNING: System property [common.loader] failed to update and remains 
> ["${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar"]


I think you’re running into a bit of a chicken-and-egg situation here. Some of 
the items in catalina.properties, especially common.loader, cannot be handled 
by the standard property replacement mechanism since the files named by the 
common.loader property have to be used during the Tomcat bootstrap operation to 
locate the property replacement classes. The bootstrap logic does allow 
replacement of any values in catalina.properties that reference environment 
variables, which is how the default common.loader settings work.

If you really want to change the locations pointed to by common.loader, you’ll 
need to edit catalina.properties directly.

You can use the documented property replacement mechanism to adjust values in 
the various *.xml configuration files; if you have specific ones of those you 
want to change, we can probably provide examples.

  - Chuck


> I've looked at the docs, and all I'm really finding is the following:
> 
> Property replacements
> Property
> Description
> org.apache.tomcat.util.digester. PROPERTY_SOURCE
> 
> Set this to a comma separated list of fully qualified name of classes that 
> implement org.apache.tomcat.util.IntrospectionUtils.PropertySource. Required 
> to have a public constructor with no arguments.
> 
> Use this to add a property source, that will be invoked when 
> ${parameter:-default-value} denoted parameters (with optional default values) 
> are found in the XML files that Tomcat parses.
> 
> Property replacement from the specified property source on the JVM system 
> properties can also be done using the REPLACE_SYSTEM_PROPERTIES system 
> property.
> 
> org.apache.tomcat.util.digester.ServiceBindingPropertySource can be used to 
> replace parameters from any Kubernetes service bindings that follows the 
> servicebinding.io spec
> 
> org.apache.tomcat.util.digester.EnvironmentPropertySource can be used to 
> replace parameters from the process' environment variables, e.g. injected 
> ConfigMaps or Secret objects in container based systems like OpenShift or 
> Kubernetes.
> 
> org.apache.tomcat.util.digester.SystemPropertySource does replacement with 
> system properties. It is always enabled, but can also be specified as part of 
> the property value.
> org.apache.tomcat.util.digester. REPLACE_SYSTEM_PROPERTIES
> 
> Set this boolean system property to true to cause property replacement from 
> the digester property source on the JVM system properties.
> 
> Any good examples of how to use it properly would be great.
> 
> Thank you for your time.
> 
> Dream * Excel * Explore * Inspire
> Jon McAlexander
> Senior Infrastructure Engineer
> Asst. Vice President
> He/His
> 
> Middleware Product Engineering
> Enterprise CIO | EAS | Middleware | Infrastructure Solutions
> 
> 8080 Cobblestone Rd | Urbandale, IA 50322
> MAC: F4469-010
> Tel 515-988-2508 | Cell 515-988-2508
> 
> jonmcalexan...@wellsfargo.com
> This message may contain confidential and/or privileged information. If you 
> are not the addressee or authorized to receive this for the addressee, you 
> must not use, copy, disclose, or take any action based on this message or any 
> information herein. If you have received this message in error, please advise 
> the sender immediately by reply e-mail and delete this message. Thank you for 
> your cooperation.
> 


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



Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.

2023-12-06 Thread Bodavula, Sai Vamsi Mohan Krishna (TR Technology)
Hello Christopher.
Thanks for the response!

Let me walk you through the Environment.,
I have a cluster and I am installing multiple microservices in the cluster. And 
one of the microservices I am integrating the JMX on of the microservices.,
and the mentioned IP of the pod is being changed dynamically after each 
deployment .

Here are the annotations that I am using in my deployment:
- name: JAVA_OPTS
#   value: >-
# -Dcom.sun.management.jmxremote
# -Dcom.sun.management.jmxremote.authenticate=false
# -Dcom.sun.management.jmxremote.ssl=false
# -Dcom.sun.management.jmxremote.local.only=false
# -Dcom.sun.management.jmxremote.port=49151
# -Dcom.sun.management.jmxremote.rmi.port=49151
# 
-Djava.rmi.server.hostname=lab1workflow4scalsvc2zus1-service.hqm-lab1.svc.cluster.local

as i said , I have implemented these in three scenarios., Catalina_opts / 
Java_opts / Java_Tool_opts

I have tried deploying catalina_ots and Java_opts as in the case of above 
mentioned.
I also tried other way, mentioning all these in the values.yaml file ( I am 
using Helm Deployment to upgrade my deployments) and referring these 
annotations as , and mentioning them in the Value
env:
- name: CATALINA_OPTS
  value: {{ .Values.deployment.javaVMMemoryArgument }}


getting netstat output from my pod:
root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address   Foreign Address State   
PID/Program name
tcp6   0  0 :::10109:::*LISTEN  
1/java
tcp6   0  0 :::9109 :::*LISTEN  
1/java

root@lab1workflow4scalsvc2zus1-deployment-fd64ff775-cwzn6:/# ps aux | grep 
tomcat
root 563  0.0  0.0   6328   748 pts/0S+   15:55   0:00 grep 
--color=auto tomcat

right now , I am passing my args with Catalina_opts in my deployment and I am 
not able to get any tomcat process pid while i check with netstat -apn , I can 
see multiple Java Process but not single tomcat process

My Jmx port is being configured as a service., so that it could be bounded with 
Tcp protocol externally to the container., and allow all tcp connections.

Hope I am able to provide you some detailed information.,
Please let me know., if I can help you with anything in further!

Thanks & Regards,
--

SAI VAMSI .B
Senior DevOps Engineer



From: Christopher Schultz 
Sent: Wednesday, December 6, 2023 20:40
To: users@tomcat.apache.org 
Subject: Re: [EXT] Re: Datadog _ JMX Integration facing connection issues.

Sai Vamsi,

On 12/5/23 08:57, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote:
> I have added my annotations in Catalina_opts ., and I am not able to see any 
> Java Process with the JMX, neither the port is being listened.
> It came back to previous stage where Annotations are not on the JVM .,
> Came back to previous stage, where connection refused error.,  as follows.
>
> Could not initialize instance: tomcat-10.75.12.136-49151:
> java.util.concurrent.ExecutionException: java.io.IOException: Failed to 
> retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root 
> exception is java.rmi.ConnectException: Connection refused to host: 
> 10.75.12.136; nested exception is:
>  java.net.ConnectException: Connection refused (Connection refused)]
>  at 
> java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
>  at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
>  at org.datadog.jmxfetch.App.processRecoveryResults(App.java:953)
>  at org.datadog.jmxfetch.App$5.invoke(App.java:927)
>  at 
> org.datadog.jmxfetch.tasks.TaskProcessor.processTasks(TaskProcessor.java:63)
>  at org.datadog.jmxfetch.App.init(App.java:917)
>  at org.datadog.jmxfetch.App.start(App.java:413)
>  at org.datadog.jmxfetch.App.run(App.java:173)
>  at org.datadog.jmxfetch.JmxFetch.main(JmxFetch.java:57)
>  at org.datadog.jmxfetch.App.main(App.java:91)

Right: the DataDog server is unable to connect to your appication via
JMX. I'm assuming that 10.75.12.136 is the IP where Tomcat is running,
and that DataDog isn't running on that server. It's on some other IP, right?

> Here we were not able to find any process , to confirm that atleast
> port is being listened to.
What is your exact CATALINA_OPTS value (masking any secrets that may be
in there).

Is Tomcat definitely running? Can you prove that with a "ps" listing,
for example? That will also confirm it's running with the proper
CATALINA_OPTS settings.

Can you run "netstat" and show all of the ports your Tomcat process is
listening to?

I'm assuming that your Tomcat process is being hosted in some kind of
container. Is the IP address 10

RE: Looking for examples...

2023-12-06 Thread Mcalexander, Jon J.
I was hoping to find some use cases with examples.

Thank you!

Dream * Excel * Explore * Inspire
Jon McAlexander
Senior Infrastructure Engineer
Asst. Vice President
He/His

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.

> -Original Message-
> From: Christopher Schultz 
> Sent: Wednesday, December 6, 2023 9:20 AM
> To: users@tomcat.apache.org
> Subject: Re: Looking for examples...
> 
> Jon,
> 
> On 12/5/23 19:02, Mcalexander, Jon J. wrote:
> > I am trying to find decent examples for Property Replacements in
> > Catalina.properties. I have an instance that is giving me the
> > following Warning and it bugs me:
> >
> > Dec 05, 2023 5:48:51 PM org.apache.tomcat.util.digester.Digester
> > replaceSystemProperties
> > WARNING: System property [common.loader] failed to update and
> remains
> > ["${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}
> > /lib","${catalina.home}/lib/*.jar"]
> 
> Is anything specifically not working, or are you just trying to get this 
> warning
> to go away?
> 
> > I've looked at the docs, and all I'm really finding is the following:
> 
> So... which property source are you actually using? Or are you using the
> default?
> 
> -chris
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Possible AbstractProtocol.waitingProcessors leak in Tomcat 9.0.75

2023-12-06 Thread Mark Thomas
I have spent some more time on this today and I am still unable to 
recreate these results on either Linux or Windows using the Snake 
WebSocket example that ships with Tomcat.


To make progress I need a reproducible test case, ideally using the 
Tomcat examples from the latest release of any currently supported 
version. Failing that, the source code for the bare minimum web 
application required to reproduce the issue.


At this point, it is still not clear if this is a Tomcat or an 
application issue.


Mark


On 06/12/2023 07:34, Jakub Remenec wrote:

Hi,

I've experienced the same issue as described on Apache Tomcat 10.1.13.
After downgrading to 10.1.5 it started to work correctly. I also inspected
the heapdump of the application with memory problems and found out that
there were many org.apache.tomcat.websocket.WsSession present in
OUTPUT_CLOSED state. When I tried locally, I found out, that when I open
few websocket connections from Chrome and then go to Offline mode the
WsSessions remain in OUTPUT_CLOSED state. New connections afterwards have
state OPEN. In heapdump from production I saw around 4600 WsSessions but
only 40 were open. The rest was in the output closed state.
WsSessions are accessible through org.apache.coyote.AbstractProtocol ->
waitingProcessors Set. In heapdump and it was clearly visible that 49% of
heap was taken by the waitingProcessors set. When tomcat was downgraded to
10.1.5, I saw that WsSessions got cleared after going to offline mode.

Additional info - I've set the session timeout to 10minutes. The app uses
Java 17 with Spring Boot 3.1.x stack. It does not use any external STOMP
broker relay.

Regards,
Jakub.

On 2023/08/20 22:44:46 Mark Thomas wrote:

On 20/08/2023 05:21, Mark Thomas wrote:

On 18/08/2023 11:28, Rubén Pérez wrote:





I started experiencing exactly the same issue when updating from Spring
6.0.7 to 6.0.9, therefore updating tomcat from 10.1.5 to 10.1.8. The
Memory
leak is very clearly visible in my monitoring tools. A further heap

dump

reveals like many times more entries in waitingProcessors map than real
active connections, and we end up with like 8 retained GB in memory
full of
those entries.

I believe I have found a way to reproduce the issue locally. Open a
websocket session from a client in Chrome, go to dev-tools and switch

the

tab to offline mode, wait > 50secs, go and switch it back to No
Throttling.
Sometimes I get an error back to the client like:

a["ERROR\nmessage:AMQ229014\\c Did not receive data from
/192.168.0.1\\c12720
within the 5ms connection TTL. The connection will now be
closed.\ncontent-length:0\n\n\u"]

And other times I get instead something like c[1002, ""] from Artemis
followed by an "Invalid frame header" error from Chrome (websockets
view in
dev-tools).

Only when it is the latter case, looks to be leaking things in that

map.

Maybe it is a casualty or not, but that is what I have observed at
least 2
times.

After the error appeared, I waited long enough for FE to reconnect the
session, and then I just quitted Chrome.


Thanks for the steps to reproduce. That is helpful. I'll let you know
how I get on.


Unfortunately, I didn't get very far. Based on the log messages it looks
very much like those are application generated rather than Tomcat

generated.


At this point I am wondering if this is an application or a Tomcat
issue. I'm going to need a sample application (ideally as cut down as
possible) that demonstrates the issue to make progress on this.

Another option is debugging this yourself to figure out what has
changed. I can provide some pointers if this is of interest. Giv en you
can repeat the issue reaosnable reliably, tracking down the commit that
trigger the change isn't too hard.


Again, after forcefully downgrading Tomcat 10.1.8 to 10.1.5 while
preserving the same Spring version, the issue is gone (confirmed in
production), in fact I have never managed to get an "Invalid frame
header"
in Chrome again with Tomcat 10.1.5 (in like 10 attempts). Before I got

it

in 2 out of 4 attempts.


Could you do some further testing and see if you can narrow down exactly



which version (10.1.6, 10.1.7 or 10.1.8) the issue first appears in?

It would also be helpful to confirm if the issue is still present in
10.1.12.


Answers to the above would still be helpful.

Mark

-
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



Re: (No members active in cluster group) Cannot discover members in cluster using Delta Manager with static membership Unicast

2023-12-06 Thread Manak Bisht
> I’m not a clustering expert, but perhaps the address value needs to be an
> IP address accessible to the other machine in the cluster. The above
> 127.0.0.1 (localhost) would appear to limit each receiver to the machine
> it’s running on.
>
Yes, that was it. Replacing the address with "0.0.0.0" fixed the issue.
Thanks for pointing that out.

Sincerely
Manak Bisht


Re: (No members active in cluster group) Cannot discover members in cluster using Delta Manager with static membership Unicast

2023-12-06 Thread Manak Bisht
Thanks a lot for the informative reply, Chris. I really appreciate it.


> If you have a good reason to disable stickness, I'd love to hear the
> reasoning.
>
While both the DeltaManager and BackupManager solve my problem of
autoscaling/failover without any re-logins required, I have noticed a lot
of load imbalance on my servers due to user usage patterns. I haven't been
able to figure out an alternate way to solve that.
My session object is also fully/largely immutable, so I am thinking that I
won't encounter the parallel requests problem.

Sincerely
Manak Bisht


Re: (No members active in cluster group) Cannot discover members in cluster using Delta Manager with static membership Unicast

2023-12-06 Thread Manak Bisht
> Also, the documentation also says that the *distributable *tag is
> deprecated and ignored since Tomcat 8 (
> https://tomcat.apache.org/migration-9)
> *"The distributable attribute has been deprecated in 8.0 and specified
> value is ignored."*
>
*Note for future readers: *In the previous email, I *incorrectly* mentioned
that the  tag (in the *web.xml*) had been deprecated. The
documentation is referring to the *distributable *attribute of the *Manager
*component.

Sincerely
Manak Bisht


Re: (No members active in cluster group) Cannot discover members in cluster using Delta Manager with static membership Unicast

2023-12-06 Thread Manak Bisht
Hi Mark
Could you please clarify this?

On Fri, Dec 1, 2023 at 3:40 PM Manak Bisht  wrote:

> The channelStartOptions setting is from the documentation
> https://tomcat.apache.org/tomcat-8.5-doc/config/cluster.html
> *"To start a channel without multicasting, you would want to use the value
> Channel.SND_RX_SEQ | Channel.SND_TX_SEQ that equals to 3. "*
>
> On Fri, Dec 1, 2023 at 2:21 PM Mark Thomas  wrote:
>
>> > > >  channelSendOptions="6" channelStartOptions="3">
>>
>> Why channelStartOptions=3 ? I think this shoudl use the default.
>>
>
Sincerely
Manak Bisht


Re: Thread Pool Question

2023-12-06 Thread Deepak Lalchandani
Hi Tomcat users,
  Can you share the jsp code of thread pool so
that I can analyse it

Thanks and Regards,
Deepak

On Wed, 6 Dec 2023, 8:46 pm Christopher Schultz, <
ch...@christopherschultz.net> wrote:

> William,
>
> On 12/5/23 14:39, William Crowell wrote:
> > I should clarify the ask here…
> >
> > I have some long running JDBC queries against Oracle, and I do not
> > want to tie up Tomcat’s web thread pool with them.  I would only have
> > between 1-10 threads in this pool.
>
> Executors aren't directly-accessible by applications. If you want to
> off-load processing to another thread, you'll have to maintain your own
> thread-pool.
>
> If you are using plain-old servlet dispatching, then off-loading to
> another thread won't save you anything: your request-processing thread
> will have to wait on your database-processing thread to complete before
> returning a response. It sounds like what you really want is
> servet-async where you put the request to sleep while you do something
> time-consuming and let the request-processing thread go back into the pool.
>
> If you really are running the thread in the background, say, across
> requests, then you can do this with a thread pool that you, say, store
> in the application scope. I've done this myself, and end up storing a
> "progress object" in the user's session so that any subsequent request
> can check on the status of the long-running process.
>
> -chris
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: (No members active in cluster group) Cannot discover members in cluster using Delta Manager with static membership Unicast

2023-12-06 Thread Deepak Lalchandani
Hi,
  Can you please 🙏  share what's going on in this post

Thanks and Regards,
Deepak Lalchandani

On Wed, 6 Dec 2023, 10:59 pm Manak Bisht,  wrote:

> Hi Mark
> Could you please clarify this?
>
> On Fri, Dec 1, 2023 at 3:40 PM Manak Bisht  wrote:
>
> > The channelStartOptions setting is from the documentation
> > https://tomcat.apache.org/tomcat-8.5-doc/config/cluster.html
> > *"To start a channel without multicasting, you would want to use the
> value
> > Channel.SND_RX_SEQ | Channel.SND_TX_SEQ that equals to 3. "*
> >
> > On Fri, Dec 1, 2023 at 2:21 PM Mark Thomas  wrote:
> >
> >> >  >> >  channelSendOptions="6" channelStartOptions="3">
> >>
> >> Why channelStartOptions=3 ? I think this shoudl use the default.
> >>
> >
> Sincerely
> Manak Bisht
>


Re: 9.0.83 addSslHostConfig failures?

2023-12-06 Thread Daniel Skiles
I've had no success digging into this.

Is this a regression, or was this an intentional change?

On Mon, Nov 27, 2023 at 8:56 AM Daniel Skiles  wrote:

> Thanks for taking a look.  My lightly scrubbed connector example is
> attached.
>
> On Tue, Nov 21, 2023 at 6:45 AM Michael Osipov 
> wrote:
>
>> On 2023/11/21 11:25:11 Michael Osipov wrote:
>> > On 2023/11/20 22:14:14 Daniel Skiles wrote:
>> > > Was there a change to the addSslHostConfig JMX mbean operation between
>> > > 9.0.82 and 9.0.83?  I have some code that works in 82, but fails with
>> an
>> > > MBeanException: Cannot find operation [addSslHostConfig] in 9.0.83.
>> > >
>> > > When I attempt to look at the available operations on ProtocolHandler
>> in
>> > > jconsole, it throws an exception in 83 that opens a new window, but
>> works
>> > > in 82.
>> >
>> > I have the following with 8.5.x:
>> > > Error setting Operation panel :org.apache.coyote.Request
>> > > Error setting Operation panel :org.apache.tomcat.util.net
>> .SSLHostConfig
>> >
>> > addSslHostConfig is greyed out for me...let me go back a patch
>> version...
>>
>> Tried on 8.5.92, same behavior. You should share your connector config.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>


Re: 9.0.83 addSslHostConfig failures?

2023-12-06 Thread Daniel Skiles
I found the source of the problem

9.0.82 accepts the simple class name as a type parameter for the operation.

9.0.83 requires the canonical class name.

On Wed, Dec 6, 2023 at 3:06 PM Daniel Skiles  wrote:

> I've had no success digging into this.
>
> Is this a regression, or was this an intentional change?
>
> On Mon, Nov 27, 2023 at 8:56 AM Daniel Skiles 
> wrote:
>
>> Thanks for taking a look.  My lightly scrubbed connector example is
>> attached.
>>
>> On Tue, Nov 21, 2023 at 6:45 AM Michael Osipov 
>> wrote:
>>
>>> On 2023/11/21 11:25:11 Michael Osipov wrote:
>>> > On 2023/11/20 22:14:14 Daniel Skiles wrote:
>>> > > Was there a change to the addSslHostConfig JMX mbean operation
>>> between
>>> > > 9.0.82 and 9.0.83?  I have some code that works in 82, but fails
>>> with an
>>> > > MBeanException: Cannot find operation [addSslHostConfig] in 9.0.83.
>>> > >
>>> > > When I attempt to look at the available operations on
>>> ProtocolHandler in
>>> > > jconsole, it throws an exception in 83 that opens a new window, but
>>> works
>>> > > in 82.
>>> >
>>> > I have the following with 8.5.x:
>>> > > Error setting Operation panel :org.apache.coyote.Request
>>> > > Error setting Operation panel :org.apache.tomcat.util.net
>>> .SSLHostConfig
>>> >
>>> > addSslHostConfig is greyed out for me...let me go back a patch
>>> version...
>>>
>>> Tried on 8.5.92, same behavior. You should share your connector config.
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>


Re: Looking for examples...

2023-12-06 Thread Christopher Schultz

Jon,

On 12/6/23 11:34, Mcalexander, Jon J. wrote:

I was hoping to find some use cases with examples.


I recently set up a local environment using the 
ServiceBindingPropertySource. The idea is that there are only a few 
options for configuring Tomcat-provided database connections for an 
application:


1. Hard-code the connection string, credentials, etc. into your 
application's META-INF/context.xml file


2. Use replaceable parameters in your META-INF/context.xml for such 
things, and use your build-process to merge them (this is what we 
currently do at $work)


3. Configure the connection in conf/server.xml and use  in 
META-INF/context.xml (or with  in WEB-INF/web.xml?)


4. Something else

I'm interested in how to deploy copies of an application on-the-fly and 
since k8s does that kind of thing and, well, the 
ServiceBindingPropertySource was built for this kind of thing, I decided 
that #4 above could be "use ServiceBindingPropertySource".


export 
CATALINA_BASE=-Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.ServiceBindingPropertySource


(among other things, of course)

export SERVICE_BINDING_ROOT=/path/to/your/stuff

find /path/to/your/stuff

/myapp
/myapp/jdbc-url
/myapp/jdbc-username
/myapp/jdbc-password

cat /path/to/your/stuff/myapp/*
jdbc:yadda...
scott
tiger

(note that these files actually have no trailing \n characters. I added 
them for readability in this post)


In META-INF/context.xml, I have this:

  1. I used "chomp:" which allows me to have files which have trailing 
newlines which will be removed by the ServiceBindingPropertySource 
because figuring out how to get vi to stop adding a trailing \n to a 
text file is a pain in the neck. Forget the fact that my files don't 
actually have those trailing \ns in them. I did it "just in case".


2. I have supplied "default values". If the file specified in the 
${filename} doesn't exist, you get the default. For example, I have no 
file named myapp/jdbc-driver, and so the default MySQL driver class name 
specified in the configuration will be used.


I had a few issues getting started. First, the documentation is sorely 
inadequate. I had to read code and finagle a few things to get it to 
work in the first place. I also added the "chomp:" thing to the 
ServiceBindingPropertySource because the trailing newline thing annoyed 
me so much. Second... *environment variable*? /Seriously?/ Well, that's 
how servicebinding.io defines things. I think it would make sense to use 
a system property possibly as an alternative.


Works as it says on the tin, once you get it going.

I mentioned that we use our build-process to, well, build our 
configuration files. That's been great, but it means we need or 
tool-chain installed in production and we can't just e.g. drop a WAR 
someplace and have it deploy. We use that process for building the 
Tomcat installation as well, including conf/server.xml.


We use replaceable parameters for all of the following in server.xml:

- Shutdown port
- Connector port
- Non-TLS connector port
- JVM-route

We could set these things as system properties during JVM launch and 
leave the parameterized stuff in the file we actually deploy. One fewer 
step in the deployment process. But we've had this system in place for 
so long, there's no particular reason to switch from build-replacement 
to deploy-replacement, so we haven't done it.


Moving to something like k8s means we can't really stick with what we've 
got. Plus, k8s can act as a configuration-deployment system and it can 
do that by  writing directories full of configuration files like the 
one used by (wait for it) ServiceBindingPropertySource.


So that's the what and why with my example(s).

Hope that helps,
-chris


-Original Message-
From: Christopher Schultz 
Sent: Wednesday, December 6, 2023 9:20 AM
To: users@tomcat.apache.org
Subject: Re: Looking for examples...

Jon,

On 12/5/23 19:02, Mcalexander, Jon J. wrote:

I am trying to find decent examples for Property Replacements in
Catalina.properties. I have an instance that is giving me the
following Warning and it bugs me:

Dec 05, 2023 5:48:51 PM org.apache.tomcat.util.digester.Digester
replaceSystemProperties
WARNING: System property [common.loader] failed to update and

remains

["${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}
/lib","${catalina.home}/lib/*.jar"]


Is anything specifically not working, or are you just trying to get this warning
to go away?


I've looked at the docs, and all I'm really finding is the following:


So... which property source are you actually using? Or are you using the
default?

-chris

-
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.

Re: 9.0.83 addSslHostConfig failures?

2023-12-06 Thread Daniel Skiles
Please disregard that, I got overexcited.

It looks like you can query the operation, and it will return the correct
name and the correct parameters, but when you try to run it, you get
the following stack trace:

Caused by: javax.management.ServiceNotFoundException: Cannot find operation
[addSslHostConfig]
at
org.apache.tomcat.util.modeler.ManagedBean.getInvoke(ManagedBean.java:525)
~[tomcat-coyote.jar:9.0.83]
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
~[tomcat-coyote.jar:9.0.83]
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:814)
~[?:?]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
~[?:?]

Any ideas here?

On Wed, Dec 6, 2023 at 4:45 PM Daniel Skiles  wrote:

> I found the source of the problem
>
> 9.0.82 accepts the simple class name as a type parameter for the operation.
>
> 9.0.83 requires the canonical class name.
>
> On Wed, Dec 6, 2023 at 3:06 PM Daniel Skiles 
> wrote:
>
>> I've had no success digging into this.
>>
>> Is this a regression, or was this an intentional change?
>>
>> On Mon, Nov 27, 2023 at 8:56 AM Daniel Skiles 
>> wrote:
>>
>>> Thanks for taking a look.  My lightly scrubbed connector example is
>>> attached.
>>>
>>> On Tue, Nov 21, 2023 at 6:45 AM Michael Osipov 
>>> wrote:
>>>
 On 2023/11/21 11:25:11 Michael Osipov wrote:
 > On 2023/11/20 22:14:14 Daniel Skiles wrote:
 > > Was there a change to the addSslHostConfig JMX mbean operation
 between
 > > 9.0.82 and 9.0.83?  I have some code that works in 82, but fails
 with an
 > > MBeanException: Cannot find operation [addSslHostConfig] in 9.0.83.
 > >
 > > When I attempt to look at the available operations on
 ProtocolHandler in
 > > jconsole, it throws an exception in 83 that opens a new window, but
 works
 > > in 82.
 >
 > I have the following with 8.5.x:
 > > Error setting Operation panel :org.apache.coyote.Request
 > > Error setting Operation panel :org.apache.tomcat.util.net
 .SSLHostConfig
 >
 > addSslHostConfig is greyed out for me...let me go back a patch
 version...

 Tried on 8.5.92, same behavior. You should share your connector config.

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