RE: [EXT]Re: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-23 Thread Rick Noel
Chuck, to get rid of the warnings...

3-Apr-2024 08:30:22.970 WARNING [Tribes-Task-Receiver[station-Channel]-1] 
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived Context 
manager doesn't exist:[##0001]

I moved my  Manager element form the server.xml to the context.xml

 

That got rid of those warnings
But Now cat log shows these new warnings

23-Apr-2024 09:19:16.288 WARNING [Tribes-Task-Receiver[station-Channel]-5] 
org.apache.catalina.ha.session.DeltaManager.deserializeSessions overload 
existing session [729421EC1DD658816E953C9A0DE4267A]

Do I need to configure something different?  Some how allow more 
deserializeSessions?




23-Apr-2024 09:19:16.243 INFO [main] 
org.apache.catalina.ha.session.DeltaManager.startInternal Starting clustering 
manager at [##0001]
23-Apr-2024 09:19:16.246 INFO [main] 
org.apache.catalina.ha.session.DeltaManager.getAllClusterSessions Manager 
[##0001], requesting session state from 
[org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 47, 
157}:4001,{192, 168, 47, 157},4001, alive=3249463, securePort=-1, UDP Port=-1, 
id={-32 -57 -12 119 64 42 67 56 -69 51 -113 -64 -68 -78 -99 74 }, payload={}, 
command={}, domain={}]]. This operation will timeout if no session state has 
been received within [60] seconds.
23-Apr-2024 09:19:16.250 INFO 
[MessageDispatchInterceptor.MessageDispatchThread[station-Channel]1] 
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.report 
ThroughputInterceptor Report[
Tx Msg:1 messages
Sent:0.00 MiB (total)
Sent:0.00 MiB (application)
Time:0.00 seconds
Tx Speed:0.15 MiB/s (total)
Tx Speed:0.15 MiB/s (application)
Error Msg:0
Rx Msg:10 messages
Rx Speed:0.00 MiB/s (since 1st msg)
Received:0.01 MiB]

23-Apr-2024 09:19:16.288 WARNING [Tribes-Task-Receiver[station-Channel]-5] 
org.apache.catalina.ha.session.DeltaManager.deserializeSessions overload 
existing session [729421EC1DD658816E953C9A0DE4267A]
23-Apr-2024 09:19:16.289 WARNING [Tribes-Task-Receiver[station-Channel]-5] 
org.apache.catalina.ha.session.DeltaManager.deserializeSessions overload 
existing session [A2196B2A82F1D0873769053130EA3E7A]
23-Apr-2024 09:19:16.290 WARNING [Tribes-Task-Receiver[station-Channel]-5] 
org.apache.catalina.ha.session.DeltaManager.deserializeSessions overload 
existing session [EDC2F576615781AD8CC138E8D8029EB9]
23-Apr-2024 09:19:16.296 WARNING [Tribes-Task-Receiver[station-Channel]-5] 
org.apache.catalina.ha.session.DeltaManager.deserializeSessions overload 
existing session [12A38E4D987184560911DC3C43A50410]
23-Apr-2024 09:19:16.354 INFO [main] 
org.apache.catalina.ha.session.DeltaManager.waitForSendAllSessions Manager 
[##0001]; session state sent at [4/23/24, 9:19 AM] received in [104] ms.

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Rick Noel
Sent: Tuesday, April 23, 2024 8:56 AM
To: Tomcat Users List 
Cc: Voodoo nmulcahy gmail ; Rob Kowald 

Subject: RE: [EXT]Re: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No 
members active in cluster group

Your suggestion worked Chuck, Thank you!

I now see this in cat log..
23-Apr-2024 08:30:10.969 INFO [Catalina-utility-1] 
org.apache.catalina.ha.tcp.SimpleTcpCluster.memberAdded Replication member 
added:[org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 47, 
157}:4001,{192, 168, 47, 157},4001, alive=304632, securePort=-1, UDP Port=-1, 
id={-32 -57 -12 119 64 42 67 56 -69 51 -113 -64 -68 -78 -99 74 }, payload={}, 
command={}, domain={}]]


INFO: Starting clustering manager at [##0001] Apr 23, 2024 8:30:46 AM 
org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
INFO: Manager [##0001], requesting session state from 
[org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 47, 
157}:4001,{192, 168, 47, 157},4001, alive=340143, securePort=-1, UDP Port=-1, 
id={-32 -57 -12 119 64 42 67 56 -69 51 -113 -64 -68 -78 -99 74 }, payload={}, 
command={}, domain={}]]. This operation will timeout if no session state has 
been received within [60] seconds.
23-Apr-2024 08:30:46.492 INFO 
[MessageDispatchInterceptor.MessageDispatchThread[station-Channel]1] 
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.report 
ThroughputInterceptor Report[
Tx Msg:1 messages
Sent:0.00 MiB (total)
Sent:0.00 MiB (application)
Time:0.00 seconds
Tx Speed:0.15 MiB/s (total)
Tx Speed:0.15 MiB/s (application)
Error Msg:0
Rx Msg:10 messages
Rx Speed:0.00 MiB/s (since 1st msg)
Received:0.01 MiB]

Apr 23, 2024 8:30:46 AM org.apache.catalina.ha.session.DeltaManager 
waitForSendAllSessions
INFO: Manager [##0001]; session state sent at [4/23/24, 8:30 AM] received in 
[104] ms.


But  could you now explain why I get these new warnings

3-Apr-2024 08:30:22.970 WARNING [Tribes-Task-Receiver[station-Channel]-1

RE: [EXT]Re: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-23 Thread Rick Noel
Your suggestion worked Chuck, Thank you!

I now see this in cat log..
23-Apr-2024 08:30:10.969 INFO [Catalina-utility-1] 
org.apache.catalina.ha.tcp.SimpleTcpCluster.memberAdded Replication member 
added:[org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 47, 
157}:4001,{192, 168, 47, 157},4001, alive=304632, securePort=-1, UDP Port=-1, 
id={-32 -57 -12 119 64 42 67 56 -69 51 -113 -64 -68 -78 -99 74 }, payload={}, 
command={}, domain={}]]


INFO: Starting clustering manager at [##0001]
Apr 23, 2024 8:30:46 AM org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
INFO: Manager [##0001], requesting session state from 
[org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 47, 
157}:4001,{192, 168, 47, 157},4001, alive=340143, securePort=-1, UDP Port=-1, 
id={-32 -57 -12 119 64 42 67 56 -69 51 -113 -64 -68 -78 -99 74 }, payload={}, 
command={}, domain={}]]. This operation will timeout if no session state has 
been received within [60] seconds.
23-Apr-2024 08:30:46.492 INFO 
[MessageDispatchInterceptor.MessageDispatchThread[station-Channel]1] 
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.report 
ThroughputInterceptor Report[
Tx Msg:1 messages
Sent:0.00 MiB (total)
Sent:0.00 MiB (application)
Time:0.00 seconds
Tx Speed:0.15 MiB/s (total)
Tx Speed:0.15 MiB/s (application)
Error Msg:0
Rx Msg:10 messages
Rx Speed:0.00 MiB/s (since 1st msg)
Received:0.01 MiB]

Apr 23, 2024 8:30:46 AM org.apache.catalina.ha.session.DeltaManager 
waitForSendAllSessions
INFO: Manager [##0001]; session state sent at [4/23/24, 8:30 AM] received in 
[104] ms.


But  could you now explain why I get these new warnings

3-Apr-2024 08:30:22.970 WARNING [Tribes-Task-Receiver[station-Channel]-1] 
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived Context 
manager doesn't exist:[##0001]
23-Apr-2024 08:30:22.972 WARNING [Tribes-Task-Receiver[station-Channel]-2] 
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived Context 
manager doesn't exist:[##0001]
23-Apr-2024 08:30:32.978 WARNING [Tribes-Task-Receiver[station-Channel]-4] 
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived Context 
manager doesn't exist:[##0001]
23-Apr-2024 08:30:32.980 WARNING [Tribes-Task-Receiver[station-Channel]-3] 
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived Context 
manager doesn't exist:[##0001]
23-Apr-2024 08:30:42.988 WARNING [Tribes-Task-Receiver[station-Channel]-5] 
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived Context 
manager doesn't exist:[##0001]
23-Apr-2024 08:30:42.990 WARNING [Tribes-Task-Receiver[station-Channel]-6] 
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived Context 
manager doesn't exist:[##0001]
Apr 23, 2024 8:30:46 AM org.apache.catalina.util.SessionIdGeneratorBase 
createSecureRandom
WARNING: Creation of SecureRandom instance for session ID generation using 
[SHA1PRNG] took [32,646] milliseconds.






Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale 
Sent: Monday, April 22, 2024 10:08 PM
To: Tomcat Users List 
Subject: [EXT]Re: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No 
members active in cluster group


> On Apr 22, 2024, at 18:48, Rick Noel  wrote:
>
> So you mean we use the VM's  IP as the address value below
> Instead or using the value of   auto  ?
>
> address="auto"
>port="4001"
>   autoBind="100"
>   selectorTimeout="5000"
>   maxThreads="6"/>


Correct. To quote from the Tomcat doc:

The IP broadcasted is java.net.InetAddress.getLocalHost().getHostAddress() 
(make sure you don't broadcast 127.0.0.1, this is a common error)

Unless the two JVMs are deployed on the same VM, you cannot use 127.0.0.1 and 
expect them to be able to communicate with each other.

Here's an old e-mail describing the issue and one way of addressing it:

https://marc.info/?l=tomcat-user=118764351104059=2

The gist of it is this:

1. check what name the command `hostname` spits out 2. make sure that 
/etc/hosts contains that hostname and IP address

This must be done on each VM, of course.

Returning localhost is typical for systems that use DHCP to obtain their IP 
addresses, such as my MacBook:

jshell> java.net.InetAddress.getLocalHost().getHostAddress();
$1 ==> "127.0.0.1"

  - Chuck

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.



RE: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Rick Noel
Chuck,

So you mean we use the VM's  IP as the address value below
Instead or using the value of   auto  ?






Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale  
Sent: Monday, April 22, 2024 6:20 PM
To: Tomcat Users List 
Subject: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active 
in cluster group


> On Apr 22, 2024, at 16:33, Rick Noel  wrote:
>
> Tomcats are two different VMs


Which explains why they can’t talk to each other over 127.0.0.1.


> What do you mean each containers published IP


Each VM or container will have an assigned, individual IP address so it can 
communicate with networks outside of the VM (eg, the host machine or real 
world). You must use each VM’s assigned IP address - not 127.0.0.1 - in the 
clustering configuration to allow the two VMs to communicate with each other.

  - Chuck

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



RE: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Rick Noel


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale  
Sent: Monday, April 22, 2024 4:41 PM
To: Tomcat Users List 
Subject: [EXT]Re: Tomcat 10 skipping state transfer. No members active in 
cluster group


> On Apr 22, 2024, at 09:54, Rick Noel  wrote:
>
> Could someone please explain why I am getting the error
>
> skipping state transfer. No members active in cluster group


Need a bit more information.


> On one sever the reciever  is bound  to  
> 127.0.0.1:4002
> And on the other server the receiver is bound to   127.0.0.1:4001


Are both Tomcat instances running on the same system (VM or real)?

Tomcats are two different VMs


> But both servers report -> no active members in cluster group


Indicates they can’t see each other, so they could be on different systems or 
in separate VMs (containers).


> Apr 22, 2024 10:20:01 AM org.apache.catalina.util.SessionIdGeneratorBase 
> createSecureRandom
> WARNING: Creation of SecureRandom instance for session ID generation using 
> [SHA1PRNG] took [51,791] milliseconds.


This long random ID generation is typical for a low-entropy VM or container 
rather than a real system. If the two Tomcats are in separate containers, 
you’ll have to configure clustering to use each container’s published IP 
address rather than assuming they can share the same loopback network.

What do you mean each containers published IP

  - Chuck


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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Rick Noel
Hello,

Could someone please explain why I am getting the error

skipping state transfer. No members active in cluster group

On one sever the reciever  is bound  to  127.0.0.1:4002
And on the other server the receiver is bound to   127.0.0.1:4001

But both servers report -> no active members in cluster group


22-Apr-2024 10:19:06.726 INFO [main] 
org.apache.catalina.core.StandardService.startInternal Starting service 
[Station]
22-Apr-2024 10:19:06.727 INFO [main] 
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: 
[Apache Tomcat/10.1.20]
22-Apr-2024 10:19:06.736 INFO [main] 
org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal Cluster is about to 
start
22-Apr-2024 10:19:06.750 INFO [main] 
org.apache.catalina.tribes.transport.ReceiverBase.bind Receiver Server Socket 
bound to:[/127.0.0.1:4002]
22-Apr-2024 10:19:06.762 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket Setting 
cluster mcast soTimeout to [500]
22-Apr-2024 10:19:06.771 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping 
for [1000] milliseconds to establish cluster membership, start level:[4]
22-Apr-2024 10:19:07.771 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done 
sleeping, membership established, start level:[4]
22-Apr-2024 10:19:07.773 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping 
for [1000] milliseconds to establish cluster membership, start level:[8]
22-Apr-2024 10:19:08.774 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done 
sleeping, membership established, start level:[8]
22-Apr-2024 10:19:08.790 INFO [main] 
org.apache.catalina.ha.session.JvmRouteBinderValve.startInternal 
JvmRouteBinderValve started
22-Apr-2024 10:19:08.803 INFO [main] 
org.apache.catalina.startup.HostConfig.deployWAR Deploying web application 
archive [/home/web/servers/apache-tomcat-10.1.20/station/ROOT##0001.war]
Apr 22, 2024 10:20:01 AM org.apache.catalina.util.SessionIdGeneratorBase 
createSecureRandom
WARNING: Creation of SecureRandom instance for session ID generation using 
[SHA1PRNG] took [51,791] milliseconds.
Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager 
startInternal
INFO: Register manager [##0001] to cluster element [Host] with name [station]
Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager 
startInternal
INFO: Starting clustering manager at [##0001]
Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
INFO: Manager [##0001]: skipping state transfer. No members active in cluster 
group.


Here is how I have clustering set up on server one



   

  

 

 

  

  

  
  
  

  


On the other server I just changed  the member ship  to a different port   
port="45564"
And reciver port to   a different port also 
   port="4002"


In my application level web.xml on both servers I have included the needed tag


What am I missing here?


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



clustering logging erors Tomcat10 with Java 17

2024-04-18 Thread Rick Noel
Hello,

Can someone try to explain what this Catalina.log snippet is saying in regards 
to clustering status?

It looks like to me, this machine successfully sent a session data state msg to 
the other machine in the cluster, but 60 sec later the other machine did not 
respond with with its session data state

*


INFO: Starting clustering manager at [##0001]
Apr 18, 2024 9:42:21 AM org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
INFO: Manager [##0001], requesting session state from 
[org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 
1}:4001,{127, 0, 0, 1},4001, alive=2087779, securePort=-1, UDP Port=-1, id={-96 
81 2 46 1 32 64 76 -97 -53 -48 3 -22 122 -8 28 }, payload={}, command={}, 
domain={}]]. This operation will timeout if no session state has been received 
within [60] seconds.
18-Apr-2024 09:42:21.062 INFO 
[MessageDispatchInterceptor.MessageDispatchThread[station-Channel]1] 
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.report 
ThroughputInterceptor Report[
   Tx Msg:1 messages
   Sent:0.00 MiB (total)
   Sent:0.00 MiB (application)
   Time:0.00 seconds
   Tx Speed:0.15 MiB/s (total)
   Tx Speed:0.15 MiB/s (application)
   Error Msg:0
   Rx Msg:3 messages
   Rx Speed:0.00 MiB/s (since 1st msg)
   Received:0.00 MiB]
Apr 18, 2024 9:43:21 AM org.apache.catalina.ha.session.DeltaManager 
waitForSendAllSessions
SEVERE: Manager [##0001]: No session state sent at [4/18/24, 9:42 AM] received, 
timing out after [60,076] ms.
Apr 18, 2024 9:43:21 AM org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
WARNING: Manager [##0001]: Drop message [SESSION-GET-ALL] inside 
GET_ALL_SESSIONS sync phase start date [4/18/24, 9:42 AM] message date 
[4/18/24, 9:42 AM]


*
Any ideas why clustering is not working?

Here is how I have clustering defined in server.xml




 


 

   

   


   

 

   

   

   

   

 


 



 






Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



Tomcat 10 clustering is not replicating session data

2024-04-16 Thread Rick Noel
Hello,

I am running Tomcat 10.1.20 with Java 17

But our session data is being lost.

Here is snippet of the clustering I have defined..





 


 

   

   


   

 

   

   

   

   

 


 



 


Notice in sessionAttributeNameFilter that one of the session attributes I want 
replicated is   -> logged_in_user
We have to include the session data we want replicated here Correct?
logged_in_user is one we want replicated, its value is a String

When I run my app this code runs ->

public class Utils {
   public static String getUserName( HttpServletRequest request )
   {

  return (String) 
request.getSession().getAttribute("logged_in_user");
   }
}

That code returns a null value, indicating that the session value is not found.

Does anyone see something wrong with how I defined the clustering?

This below comes from the Catalina.out log and indicates there is an issue with 
clustering...

SEVERE: Manager [##0001]: No session state sent at [4/16/24, 12:48 PM] 
received, timing out after [60,074] ms.
Apr 16, 2024 12:49:54 PM org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
WARNING: Manager [##0001]: Drop message [SESSION-GET-ALL] inside 
GET_ALL_SESSIONS sync phase start date [4/16/24, 12:48 PM] message date 
[4/16/24, 12:48 PM]


Our live environment has two app server machines being fed by one loadbalancer.

In our dev environment, that has just one machine, this same session data can 
be extracted.
But not on the live 2 machine environment



Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: .intermittent InvocationTargetException errors

2024-04-15 Thread Rick Noel
meZone" is null
at 
com.radiovoodoo.action.station.ContestManager.getCustomerTimeZoneDisplayName(ContestManager.java:1195)
... 51 more
Apr 15, 2024 11:26:51 AM com.radiovoodoo.util.Log log
SEVERE:
Exception:  java.lang.NullPointerException: Cannot invoke 
"java.util.TimeZone.getDisplayName()" because "this.customerTimeZone" is null
Stack Trace follows:
java.lang.NullPointerException: Cannot invoke 
"java.util.TimeZone.getDisplayName()" because "this.customerTimeZone" is null
at 
com.radiovoodoo.action.station.ContestManager.getCustomerTimeZoneDisplayName(ContestManager.java:1195)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.radiovoodoo.display.EvalExpr.evalIdentifier(EvalExpr.java:317)
at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:57)
at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:30)
at com.radiovoodoo.display.Expr.evaluate(Expr.java:370)
at com.radiovoodoo.display.PropertyTag.evaluate(PropertyTag.java:102)
at com.radiovoodoo.display.PropertyTag.doStartTag(PropertyTag.java:55)
at 
org.apache.jsp.services.system.contesting.contest_005fschedule_005fedit_jsp._jspx_meth_ww_005fproperty_005f5(contest_005fschedule_005fedit_jsp.java:6193)
at 
org.apache.jsp.services.system.contesting.contest_005fschedule_005fedit_jsp._jspService(contest_005fschedule_005fedit_jsp.java:1299)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:456)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:653)
at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:419)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:340)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:277)
at 
com.radiovoodoo.action.ServletDispatcher.service(ServletDispatcher.java:177)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christoph

.intermittent InvocationTargetException errors

2024-04-15 Thread Rick Noel
Hello,

I am using Tomcat 10 with java 17.

I am getting itermitant jsp compile errors below.

Some times the page compiles correctly but sometimes the page hits result in 
below errors

java.lang.reflect.InvocationTargetException
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.radiovoodoo.display.EvalExpr.evalIdentifier(EvalExpr.java:317)
at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:57)

I found this explanation for possible cause..
Normally "java.lang.reflect.InvocationTargetException" occurs when java 
compiler finds 2 different classes with same name in 2 different packages.
When you are importing both classes at a time and when you are trying to create 
object of that class it throws "java.lang.reflect.InvocationTargetException" 
exception .
The solution is that when you are creating the object of the class use package 
name also along with class name so that compiler knows what class it has to use.

I looked at my code in the jsp and the code in question could be mistaking for 
two different classes.
My code is meant to use  java.util.Timezone but my code also has a  
com.radiovoodoo.customer.Timezone class
So I thought ah ah will specifical declare the class the I want, so I changed
From
private TimeZone customerTimeZone;
to
private java.util.TimeZone customerTimeZone;

so that the compiler will not think to use com.radiovoodoo.customer.Timezone 
but instead always use java.util.TimeZone
But this had no effect.

I still get intermittent java.lang.reflect.InvocationTargetException
Could this be a possible bug in   the class tomcat 10 uses to compile jsp   ->  
org.apache.jasper.servlet.JspServlet

Is there a different JspServlet class I could use to test that theory out?


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: [EXT]Re: Tomcat 10 session replication fails

2024-04-15 Thread Rick Noel
Hi Chuck,
Your suggestion did not work.

I defined Membership as suggested...


and still getting this in the logs

org.apache.catalina.ha.session.DeltaManager.startInternal Starting clustering 
manager at [##0001]
15-Apr-2024 07:55:36.744 INFO [main] 
org.apache.catalina.ha.session.DeltaManager.getAllClusterSessions Manager 
[##0001]: skipping state transfer. No members active in cluster group

Do you think the transfer is not happening because the application is only on 
one machine?
Our Production environment will have  our application on two machines but in 
our dev environment we have only one machine in the "cluster". So we really do 
not have a "cluster" environment.
Again, we would like to know is going on before we introduce clustering in our 
live environment.

We are using Java 17 and Tomcat 10


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale  
Sent: Saturday, April 13, 2024 4:00 PM
To: Tomcat Users List 
Subject: [EXT]Re: [EXT]Re: Tomcat 10 session replication fails


> On Apr 11, 2024, at 09:07, Rick Noel  wrote:
>
> We are getting closer
> Changing ports from the 5000 range to the 4000 range stopped two 
> errors But now I get this..
>
> INFO: Manager [##0001]: skipping state transfer. No members active in 
> cluster group
>
> How to I make the member machine in the cluster active?


There’s a cluster configuration option that may be coming into play here: 
localLoopbackDisabled. Once upon a time, the JDK method:
MulticastSocket.setLoopbackMode(boolean disable) did the opposite of 
what one might think from just the method name - passing in true disabled local 
receipt of multicast packets. That method has since been deprecated, and Tomcat 
currently uses this method:
 DatagramSocket.setOption​(SocketOption name, T value) which, at 
least in Java 21, operates as you might expect from the name - specifying true 
enables multicast loopback.

However, there’s some interesting logic in Tomcat's handling of 
localLoopbackDisabled that can inverts the config value based on the Java 
level, along with this comment:
Java < 14, a value of true means loopback is disabled. Java 14+ a value 
of true means loopback is enabled.

Having not dug into the JRE source code for the various Java versions, I’m not 
yet convinced the version checking logic is correct. You might try setting 
localLoopbackDisabled to true in your  config to see if that 
has an effect on your dev system.

Also, let us know what Java version you’re using.

  - Chuck


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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



RE: [EXT]Re: Tomcat 10 session replication fails

2024-04-11 Thread Rick Noel
Thanks Chuck,

We are getting closer
Changing ports from the 5000 range to the 4000 range stopped two errors 
But now I get this..

INFO: Manager [##0001]: skipping state transfer. No members active in cluster 
group

How to I make the member machine in the cluster active?


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale  
Sent: Thursday, April 11, 2024 9:14 AM
To: Tomcat Users List 
Subject: [EXT]Re: Tomcat 10 session replication fails

[You don't often get email from n82...@gmail.com. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

> On Apr 11, 2024, at 07:56, Rick Noel  wrote:
>
> We have our app running on Tomcat10 and doing clustering,but are getting the 
> following errors seen int the Catalina log...
>
> Apr 11, 2024 8:14:43 AM org.apache.catalina.ha.session.DeltaManager 
> waitForSendAllSessions
> SEVERE: Manager [##0001]: No session state sent at [4/11/24, 8:13 AM] 
> received, timing out after [60,068] ms.
> Apr 11, 2024 8:14:43 AM org.apache.catalina.ha.session.DeltaManager 
> getAllClusterSessions
> WARNING: Manager [##0001]: Drop message [SESSION-GET-ALL] inside 
> GET_ALL_SESSIONS sync phase start date [4/11/24, 8:13 AM] message date 
> [4/11/24, 8:13 AM]
> 11-Apr-2024 08:14:43.456
>
> The error, to me, indicates that the session data is not being sent out.
>
> We are running this app in our dev environment, and in this dev environment 
> the app runs on only one machine.
> In our live environment the app runs on two machines and traffic goes through 
> a load balancer.
> This may be a dumb question but are we getting these errors because we are 
> running the app on only one machine, and clustering cannot be done on one 
> machine?


Likely. From the Tomcat clustering doc:

If your Tomcat instances are running on the same machine, make sure the 
Receiver.port attribute is unique for each instance, in most cases Tomcat is 
smart enough to resolve this on it's own by autodetecting available ports in 
the range 4000-4100

You appear to have configured 5001 as the receiver port on both.


>   
>  className="org.apache.catalina.tribes.membership.McastService"
>   
> address="228.0.0.4"
>   
> port="45565"
>   
> frequency="500"
>   
> dropTime="3000"/>
>   
>  className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>   
>   address="auto"
>   
>   port="5001"
>   
>   selectorTimeout="100"
>   
>   maxThreads="6"/>


  - Chuck

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



Tomcat 10 session replication fails

2024-04-11 Thread Rick Noel
Hi,

We have our app running on Tomcat10 and doing clustering,but are getting the 
following errors seen int the Catalina log...

Apr 11, 2024 8:14:43 AM org.apache.catalina.ha.session.DeltaManager 
waitForSendAllSessions
SEVERE: Manager [##0001]: No session state sent at [4/11/24, 8:13 AM] received, 
timing out after [60,068] ms.
Apr 11, 2024 8:14:43 AM org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
WARNING: Manager [##0001]: Drop message [SESSION-GET-ALL] inside 
GET_ALL_SESSIONS sync phase start date [4/11/24, 8:13 AM] message date 
[4/11/24, 8:13 AM]
11-Apr-2024 08:14:43.456

The error, to me, indicates that the session data is not being sent out.

We are running this app in our dev environment, and in this dev environment the 
app runs on only one machine.
In our live environment the app runs on two machines and traffic goes through a 
load balancer.
This may be a dumb question but are we getting these errors because we are 
running the app on only one machine, and clustering cannot be done on one 
machine?
We need to better understand these errors before we can move to tomcat 10 
clustering into our live   2 machine environment

This is how we have clustering defined in the server.xml...





  

  

  



  


 


 

   

   


   

 

   

   

   

   

 


 



 





 



  





Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: unable to set compression, compressionMinSize and compressableMinemType attributes in UpgradeProtocol element

2024-04-02 Thread Rick Noel
Mark you were correct. I, needed to move those attributes to the Connection 
element.
Plus on top of that I had this misspelled attribute  compressableMinemType
should be compressibleMimeType

In your opinion, should we use the Upgrade UpgradeProtcol protocol?
I mean does not the semantics of its name imply it is better?


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas 
Sent: Tuesday, April 2, 2024 10:05 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: unable to set compression, compressionMinSize and 
compressableMinemType attributes in UpgradeProtocol element

On 02/04/2024 14:53, Rick Noel wrote:
> Hello,
>
> What am I missing here?

You haven't provided information on the Tomcat version you are using.
I'm assuming 10.1.x.

https://tomcat.apache.org/tomcat-10.1-doc/config/http2.html

Search for compressionMinSize.

> I get warnings that the compression related attributes of compression, 
> compressionMinSize and compressableMinemType are not being set.



> I have also tried moving of compression, compressionMinSize and
> compressableMinemType to the Connector element with same results

That seems ... unlikely. Please provide the Connector configuration and the 
error message.

> BTW, I am supposed to get improved speed by using the  UpgradeProtcol  
> Correct?

It depends. YMMV.

Mark

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



unable to set compression, compressionMinSize and compressableMinemType attributes in UpgradeProtocol element

2024-04-02 Thread Rick Noel
Hello,

What am I missing here?
I get warnings that the compression related attributes of compression, 
compressionMinSize and compressableMinemType are not being set.




02-Apr-2024 09:36:24.876 WARNING [main] 
org.apache.tomcat.util.digester.SetPropertiesRule.begin Match 
[Server/Service/Connector/UpgradeProtocol] failed to set property [compression] 
to [on]
02-Apr-2024 09:36:24.880 WARNING [main] 
org.apache.tomcat.util.digester.SetPropertiesRule.begin Match 
[Server/Service/Connector/UpgradeProtocol] failed to set property 
[compressionMinSize] to [2048]
02-Apr-2024 09:36:24.880 WARNING [main] 
org.apache.tomcat.util.digester.SetPropertiesRule.begin Match 
[Server/Service/Connector/UpgradeProtocol] failed to set property 
[compressableMimeType] to 
[text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml]



The warnings above came with this server.xml  defined.
I have also tried moving of compression, compressionMinSize and 
compressableMinemType to the Connector element with same results





  
  
  
   

BTW, I am supposed to get improved speed by using the  UpgradeProtcol  
Correct?





Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: how to define database resource in just context.xml or server.xml

2024-04-01 Thread Rick Noel
Yes and that is just what we are trying to do.  On our dev servers all five 
different applications share the same database.
So it would seem best to have the resource link in the context.xml and not 
complicate things up by putting the database link in each web application's 
web.xml.

The idea being that a developer working on one application would think if he 
changed the web.xml for his application, hey maybe I should change the other 
application's web.xml also

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas  
Sent: Sunday, March 31, 2024 1:55 PM
To: users@tomcat.apache.org
Subject: Re: [EXT]Re: how to define database resource in just context.xml or 
server.xml

On 29/03/2024 21:58, Christopher Schultz wrote:
> Rick,
> 
> On 3/29/24 14:33, Rick Noel wrote:
>> Our application is really a suite of 5applications.  And the 
>> server.xml  I am talking about is on our dev machine, where we want 
>> to run all 5 apps on the one web server.
>>
>> The context.xml has global enviroiment variables (like mail server 
>> related vars) that all the dev applications use. All the different 
>> dev applications also use the same database.
>>
>> So that is why we define resources in the context.xml  file
> It sounds like you really *do* want to define the JDBC/JNDI resource 
> in server.xml and the link it to your applications.
> 
> I think the correct way to do that is by defining it in server.xml and 
> then linking it through your applications' WEB-INF/web.xml files.
> 
> You should not have to touch CATALINA_BASE/conf/context.xml.

The only reason you might want to touch context.xml is if you want to provide 
the same resource link to all web applications rather than have to specify it 
in each web application.

Mark

> 
> -chris
> 
>> -Original Message-
>> From: Christopher Schultz 
>> Sent: Friday, March 29, 2024 2:21 PM
>> To: Tomcat Users List ; Rick Noel 
>> 
>> Subject: Re: [EXT]Re: how to define database resource in just 
>> context.xml or server.xml
>>
>> Rick,
>>
>> On 3/29/24 11:56, Rick Noel wrote:
>>> If have the resource defined in
>>> CATALINA_BASE/conf/context.xml
>>> And
>>> CATALINA_BASE/conf/server.xml
>>
>> You really shouldn't have anything custom in 
>> CATALINA_BASE/conf/context.xml. That will affect every application 
>> deployed on the server. Perhaps you only have a single application 
>> deployed, but things can get really confusing when you edit that file.
>> It also makes upgrades more difficult.
>>
>> I would recommend taking your  from 
>> CATALINA_BASE/conf/context.xml and putting it into the proper place:
>> your application's META-INF/context.xml file. You will need to 
>> surround it with  ...  since that file defines the 
>> context.
>>
>> If you have  in your CATALINA_BASE/conf/server.xml file, you 
>> should remove it. If you want to disable auto-deploy, then you can 
>> always copy your application's META-INF/context.xml file into 
>> CATALINA_BASE/conf/[engine]/[host]/[contextpath].xml.
>>
>> Finally, you should be able to delete your  from your 
>> CATALINA_BASE/conf/server.xml file entirely.
>>
>> Do you have anything in your web.xml that is related? For example:
>>
>>     
>>   jdbc/foo
>>   javax.sql.DataSource
>>   Container
>>     
>>
>> I have one of those in my web.xml, but it's not clear to be whether 
>> or not I actually need it. I have *one* of them but my application 
>> uses two different JDBC resources. Both are declared in 
>> META-INF/context.xml and both are available to the application.
>>
>> I think you need to use  in web.xml when you define 
>> "global naming resources" in server.xml. But if you put them into 
>> META-INF/context.xml it's obvious that (a) they aren't global and (b) 
>> the application expects them.
>>
>> So I would remove any global naming resources you may have in 
>> server.xml and also remove anything you don't need in web.xml.
>>
>> Doing all this will make upgrading Tomcat much easier.
>>
>> -chris
>>
>>> -Original Message-
>>> From: Christopher Schultz 
>>> Sent: Friday, March 29, 2024 11:47 AM
>>> To: users@tomcat.apache.org
>>> Subject: [EXT]Re: how to define database resource in just 
>>> context.xml or server.xml
>>>
>>> Rick,
>>>
>>> On 3/29/24 09:48, Rick Noel wrote:
>>>> Can someone tell me why I need to have my database source defined 
&g

RE: FW: [EXT]Re: how to define database resource in just context.xml or server.xml

2024-03-29 Thread Rick Noel
Yeah I like the idea of using the Resourcelink  in the context.xml and then 
keep the defining of that datasource in the server.xml

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz  
Sent: Friday, March 29, 2024 2:23 PM
To: users@tomcat.apache.org
Subject: Re: FW: [EXT]Re: how to define database resource in just context.xml 
or server.xml

Rick,

On 3/29/24 14:05, Rick Noel wrote:
> Chris,
> 
> I found I could use a ResourceLink element and put it in my context.xml file.
> The name in that ResourceLink is the name of resource that I have fully 
> defined in my server.xml.
> Sot the context.xml points to the fully define resource which is in my 
> server.xml

That's definitely a possibility as well.

I work on a small team and so separating the JDBC definition from the link 
doesn't make much sense so we don't do it. We also don't like polluting our 
server.xml file so everything goes into META-INF/context.xml.

You really should never change CATALINA_BASE/conf/context.xml, though.

-chris

> So snippet from my context.xml file is.
> 
> 
> 
>  
>  
>
> 
>  name="jdbc/app-pool"
> global="jdbc/app-pool"
>type="javax.sql.DataSource"   />
> 
> 
> And snippet from my server.xml is.
> 
> 
>
> 
>type="javax.sql.DataSource"  
> driverClassName="org.postgresql.Driver"
>  url="jdbc:postgresql://x"
>  username="x" password="xx"
>  maxTotal="30"  maxIdle="30" maxWaitMillis="-1"
>  removeAbandonedOnBorrow="true" 
> removeAbandonedTimeout="90"
>  testOnBorrow="true"  validationQuery="select 1" 
> validationQueryTimeout="3"
>  testWhileIdle="true"  
> timeBetweenEvictionRunsMillis="6"
>  testOnReturn="true"  />  
>   
> 
> 
> Rick Noel
> Systems Programmer | Westwood One
> rn...@westwoodone.com
> 
> -Original Message-
> From: Rick Noel
> Sent: Friday, March 29, 2024 11:57 AM
> To: Tomcat Users List 
> Subject: RE: [EXT]Re: how to define database resource in just 
> context.xml or server.xml
> 
> If have the resource defined in
> CATALINA_BASE/conf/context.xml
> And
> CATALINA_BASE/conf/server.xml
> 
> Rick Noel
> Systems Programmer | Westwood One
> rn...@westwoodone.com
> 
> -Original Message-
> From: Christopher Schultz 
> Sent: Friday, March 29, 2024 11:47 AM
> To: users@tomcat.apache.org
> Subject: [EXT]Re: how to define database resource in just context.xml 
> or server.xml
> 
> Rick,
> 
> On 3/29/24 09:48, Rick Noel wrote:
>> Can someone tell me why I need to have my database source defined in 
>> both my context.xml and server.xml? I thought we are suppose to 
>> define it in only one location?
> It's definitely not a requirement to specify it in both places.
> 
>> I can only log into my app if I have it defined in both my 
>> context.xml and server.xml
>>
>> Below  is my database resource   as defined in server.xml..
>>
>> I have xxx out postgres URL for security reasons
>>
>> 
>>
>>
>>
>>> type="javax.sql.DataSource"  
>> driverClassName="org.postgresql.Driver"
>> url="jdbc:postgresql://xxx"
>> username="postgres" 
>> password="postgres4now"
>> maxTotal="30"  maxIdle="30" 
>> maxWaitMillis="-1"
>> removeAbandonedOnBorrow="true" 
>> removeAbandonedTimeout="90"
>> testOnBorrow="true"  
>> validationQuery="select 1" validationQueryTimeout="3"
>> testWhileIdle="true"  
>> timeBetweenEvictionRunsMillis="6"
>> testOnReturn="true"
>>  />
>>
>>
>> 
>>
>>
>>
>> Below is my database resource   as defined in context.xml
>>
>>
>> 
>>
>>   
>>
>>
&g

RE: [EXT]Re: how to define database resource in just context.xml or server.xml

2024-03-29 Thread Rick Noel
Chris,
Our application is really a suite of 5applications.  And the server.xml  I am 
talking about is on our dev machine, where we want to run all 5 apps on the one 
web server. 

The context.xml has global enviroiment variables (like mail server related 
vars) that all the dev applications use.
All the different dev applications also use the same database.

So that is why we define resources in the context.xml  file

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz  
Sent: Friday, March 29, 2024 2:21 PM
To: Tomcat Users List ; Rick Noel 

Subject: Re: [EXT]Re: how to define database resource in just context.xml or 
server.xml

Rick,

On 3/29/24 11:56, Rick Noel wrote:
> If have the resource defined in
> CATALINA_BASE/conf/context.xml
> And
> CATALINA_BASE/conf/server.xml

You really shouldn't have anything custom in CATALINA_BASE/conf/context.xml. 
That will affect every application deployed on the server. Perhaps you only 
have a single application deployed, but things can get really confusing when 
you edit that file. 
It also makes upgrades more difficult.

I would recommend taking your  from CATALINA_BASE/conf/context.xml 
and putting it into the proper place: 
your application's META-INF/context.xml file. You will need to surround it with 
 ...  since that file defines the context.

If you have  in your CATALINA_BASE/conf/server.xml file, you should 
remove it. If you want to disable auto-deploy, then you can always copy your 
application's META-INF/context.xml file into 
CATALINA_BASE/conf/[engine]/[host]/[contextpath].xml.

Finally, you should be able to delete your  from your 
CATALINA_BASE/conf/server.xml file entirely.

Do you have anything in your web.xml that is related? For example:

   
 jdbc/foo
 javax.sql.DataSource
 Container
   

I have one of those in my web.xml, but it's not clear to be whether or not I 
actually need it. I have *one* of them but my application uses two different 
JDBC resources. Both are declared in META-INF/context.xml and both are 
available to the application.

I think you need to use  in web.xml when you define "global 
naming resources" in server.xml. But if you put them into META-INF/context.xml 
it's obvious that (a) they aren't global and (b) the application expects them.

So I would remove any global naming resources you may have in server.xml and 
also remove anything you don't need in web.xml.

Doing all this will make upgrading Tomcat much easier.

-chris

> -Original Message-
> From: Christopher Schultz 
> Sent: Friday, March 29, 2024 11:47 AM
> To: users@tomcat.apache.org
> Subject: [EXT]Re: how to define database resource in just context.xml 
> or server.xml
> 
> Rick,
> 
> On 3/29/24 09:48, Rick Noel wrote:
>> Can someone tell me why I need to have my database source defined in 
>> both my context.xml and server.xml? I thought we are suppose to 
>> define it in only one location?
> It's definitely not a requirement to specify it in both places.
> 
>> I can only log into my app if I have it defined in both my 
>> context.xml and server.xml
>>
>> Below  is my database resource   as defined in server.xml..
>>
>> I have xxx out postgres URL for security reasons
>>
>> 
>>
>>
>>
>>> type="javax.sql.DataSource"  
>> driverClassName="org.postgresql.Driver"
>> url="jdbc:postgresql://xxx"
>> username="postgres" 
>> password="postgres4now"
>> maxTotal="30"  maxIdle="30" 
>> maxWaitMillis="-1"
>> removeAbandonedOnBorrow="true" 
>> removeAbandonedTimeout="90"
>> testOnBorrow="true"  
>> validationQuery="select 1" validationQueryTimeout="3"
>> testWhileIdle="true"  
>> timeBetweenEvictionRunsMillis="6"
>> testOnReturn="true"
>>  />
>>
>>
>> 
>>
>>
>>
>> Below is my database resource   as defined in context.xml
>>
>>
>> 
>>
>>   
>>
>>
>>
>>  >type="javax.sql.DataSource"  
>> driverClassName="org.postgresql.Driver"
>>url="jdbc:postgresql://xx
>>username="postgres" password=&

FW: [EXT]Re: how to define database resource in just context.xml or server.xml

2024-03-29 Thread Rick Noel
Chris,

I found I could use a ResourceLink element and put it in my context.xml file.
The name in that ResourceLink is the name of resource that I have fully defined 
in my server.xml.
Sot the context.xml points to the fully define resource which is in my 
server.xml

So snippet from my context.xml file is.





  
   
   


And snippet from my server.xml is.


  

  
 


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Rick Noel 
Sent: Friday, March 29, 2024 11:57 AM
To: Tomcat Users List 
Subject: RE: [EXT]Re: how to define database resource in just context.xml or 
server.xml

If have the resource defined in
CATALINA_BASE/conf/context.xml
And
CATALINA_BASE/conf/server.xml

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz 
Sent: Friday, March 29, 2024 11:47 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: how to define database resource in just context.xml or 
server.xml

Rick,

On 3/29/24 09:48, Rick Noel wrote:
> Can someone tell me why I need to have my database source defined in 
> both my context.xml and server.xml? I thought we are suppose to define 
> it in only one location?
It's definitely not a requirement to specify it in both places.

> I can only log into my app if I have it defined in both my context.xml 
> and server.xml
>
> Below  is my database resource   as defined in server.xml..
>
> I have xxx out postgres URL for security reasons
>
> 
>
>
>
>   type="javax.sql.DataSource"  
> driverClassName="org.postgresql.Driver"
>url="jdbc:postgresql://xxx"
>username="postgres" 
> password="postgres4now"
>maxTotal="30"  maxIdle="30" 
> maxWaitMillis="-1"
>removeAbandonedOnBorrow="true" 
> removeAbandonedTimeout="90"
>testOnBorrow="true"  
> validationQuery="select 1" validationQueryTimeout="3"
>testWhileIdle="true"  
> timeBetweenEvictionRunsMillis="6"
>testOnReturn="true"
> />
>
>
>
>
>
>
> Below is my database resource   as defined in context.xml
>
>
> 
>
>  
>
>
>
>type="javax.sql.DataSource"  
> driverClassName="org.postgresql.Driver"
>   url="jdbc:postgresql://xx
>   username="postgres" password="postgres4now"
>   maxTotal="30"  maxIdle="30" maxWaitMillis="-1"
>   removeAbandonedOnBorrow="true" 
> removeAbandonedTimeout="90"
> testOnBorrow="true"  validationQuery="select 1" 
> validationQueryTimeout="3"
> testWhileIdle="true"  
> timeBetweenEvictionRunsMillis="6"
> testOnReturn="true"
> />

Which context.xml are you talking about? The one in CATALINA_BASE/context.xml 
or the one in your application's META-INF/context.xml?

Have you defined your  in CATALINA_BASE/conf/server.xml, or are you 
using only META-INF/context.xml?

-chris

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.



RE: [EXT]Re: how to define database resource in just context.xml or server.xml

2024-03-29 Thread Rick Noel
If have the resource defined in
CATALINA_BASE/conf/context.xml
And 
CATALINA_BASE/conf/server.xml

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz  
Sent: Friday, March 29, 2024 11:47 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: how to define database resource in just context.xml or 
server.xml

Rick,

On 3/29/24 09:48, Rick Noel wrote:
> Can someone tell me why I need to have my database source defined in 
> both my context.xml and server.xml? I thought we are suppose to define 
> it in only one location?
It's definitely not a requirement to specify it in both places.

> I can only log into my app if I have it defined in both my context.xml 
> and server.xml
>
> Below  is my database resource   as defined in server.xml..
>
> I have xxx out postgres URL for security reasons
>
> 
>
>
>
>   type="javax.sql.DataSource"  
> driverClassName="org.postgresql.Driver"
>url="jdbc:postgresql://xxx"
>username="postgres" 
> password="postgres4now"
>maxTotal="30"  maxIdle="30" 
> maxWaitMillis="-1"
>removeAbandonedOnBorrow="true" 
> removeAbandonedTimeout="90"
>testOnBorrow="true"  
> validationQuery="select 1" validationQueryTimeout="3"
>testWhileIdle="true"  
> timeBetweenEvictionRunsMillis="6"
>testOnReturn="true"
> />
>
>
>
>
>
>
> Below is my database resource   as defined in context.xml
>
>
> 
>
>  
>
>
>
>type="javax.sql.DataSource"  
> driverClassName="org.postgresql.Driver"
>   url="jdbc:postgresql://xx
>   username="postgres" password="postgres4now"
>   maxTotal="30"  maxIdle="30" maxWaitMillis="-1"
>   removeAbandonedOnBorrow="true" 
> removeAbandonedTimeout="90"
> testOnBorrow="true"  validationQuery="select 1" 
> validationQueryTimeout="3"
> testWhileIdle="true"  
> timeBetweenEvictionRunsMillis="6"
> testOnReturn="true"
> />

Which context.xml are you talking about? The one in CATALINA_BASE/context.xml 
or the one in your application's META-INF/context.xml?

Have you defined your  in CATALINA_BASE/conf/server.xml, or are you 
using only META-INF/context.xml?

-chris

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.



how to define database resource in just context.xml or server.xml

2024-03-29 Thread Rick Noel
Hello,

Can someone tell me why I need to have my database source defined in both my 
context.xml and server.xml?
I thought we are suppose to define it in only one location?

I can only log into my app if I have it defined in both my context.xml and 
server.xml


Below  is my database resource   as defined in server.xml..

I have xxx out postgres URL for security reasons





 


  



Below is my database resource   as defined in context.xml








   




Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: [EXT]Re: performance tunning of Tomcat 10

2024-03-28 Thread Rick Noel
Chris,
 my bottleneck (app slowness to respond is the at the database connection max), 
I am not even going to try and adjust minThreads and maxThreads.
When I tried to increase maxConnection to our database from and existing 
connection max of 20, to a new connectionMax of 50, I got errors, see attached 
snapshot.

I was able to raise the maxConnection to database up to 30 with no errors, so I 
am just going to deploy at that level until we upgrade our Postgess database
We are using a really old Postgres and plan in the near to future to upgrade 
that database.

BTW,
I did find and use the Apache Benchmark tool and was able to see how our app 
responses with a test requests of 1 and concurrent requests of 40 and those 
results look good to me with worst response time of only  1000 miliseconds.

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz 
Sent: Thursday, March 28, 2024 3:09 PM
To: users@tomcat.apache.org
Subject: [EXT]Re: [EXT]Re: performance tunning of Tomcat 10

Rick,

On 3/27/24 09:22, Rick Noel wrote:
> -Original Message-
> From: Christopher Schultz 
> Sent: Wednesday, March 27, 2024 8:24 AM
> To: Tomcat Users List ; Rick Noel
> 
> Cc: Voodoo nmulcahy gmail ; David Jung
> 
> Subject: [EXT]Re: performance tunning of Tomcat 10
>
> Rick,
>
> On 3/27/24 07:53, Rick Noel wrote:
>> I was wondering if the apache foundation has any tools we can use to
>> fine tune Tomcat 10. Tools to deteming how to set the best heap size
>> for Tomcat startup and the best connection attributes of
>> minSpareThreads and MaxThreads.
> What is your goal?
> Our application is a sip phone call handling application.(A voice
> response xml application) The goal is to not have  call bottleneck at peak 
> call volume.
> Sometimes too many folks call at one time hit our app and calls are not 
> handle correctly.
>
>> I know my application at times will reach 100 concurrent connections
>   > and some times goes has high as 500 connections.
>
> Okay.
> Well I do not have actual traffic info down to the sec, But from the
> application logs I know that that points in the day more than 300
> calls can come in

Okay, you need to get better information. Check out this presentation on Tomcat 
monitoring:

https://tomcat.apache.org/presentations.html#latest-monitoring-with-jmx

There is a lot in there, but I do talk about checking on the request processor 
to see how many requests are in-flight at once. You can do the same with your 
database pool.

You'll want to grab samples of those things at regular intervals to see how 
they correlate. I suspect you know when your peak times are, so schedule the 
samples to be taken during that timeframe. You could even sample once per 
second if you wanted to -- the calls are pretty inexpensive.

>> Should I boost minSpareThreads and maxThread values of what I plan to
>> use below? > Or why would we not just set very high minSpareThreads
>> and maxThread values like minSpareThreads =300  and maxThread=1000
>>
>> This is a snippet of my server.xml
>>
>> >   minSpareThreads="50"
>> maxThreads="300"/>
>>
>> >executor="tomcatPhoneAppThreadPool"
>>compression="on"
>>compressionMinSize="2048"
>>
>> compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml"
>>protocol="org.apache.coyote.http11.Http11NioProtocol"
>>  redirectPort="8443">
>>  > className="org.apache.coyote.http2.Http2Protocol" />
>>
>>
>>
>> Also, am I good with setting  
>> protocol="org.apache.coyote.http11.Http11NioProtocol"
>> And then setting > className="org.apache.coyote.http2.Http2Protocol" />
>>
>> That will tell Tomcat to do HTTP2 Correct?
>
> That's the only way to enable h2. Well... you could use Http11Nio2Protocol, 
> too. NIO is the default protocol so you don't even need to add that 
> specifically if you don't want to.
>
> Back to threads.
>
> Each thread (unless you go virtual, but that's not really production-ready 
> IMHO at this point unless you have very strict circumstances where it will 
> work great for you) takes up a bunch of memory, so you can't just set 
> maxThreads=1M. Threads take "time" to start, but it's not really that much. 
> If starting and stopping threads

RE: [EXT]Re: performance tunning of Tomcat 10

2024-03-27 Thread Rick Noel


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz  
Sent: Wednesday, March 27, 2024 8:24 AM
To: Tomcat Users List ; Rick Noel 

Cc: Voodoo nmulcahy gmail ; David Jung 

Subject: [EXT]Re: performance tunning of Tomcat 10

Rick,

On 3/27/24 07:53, Rick Noel wrote:
> I was wondering if the apache foundation has any tools we can use to 
> fine tune Tomcat 10. Tools to deteming how to set the best heap size 
> for Tomcat startup and the best connection attributes of 
> minSpareThreads and MaxThreads.
What is your goal?
Our application is a sip phone call handling application.(A voice response xml 
application)
The goal is to not have  call bottleneck at peak call volume.
Sometimes too many folks call at one time hit our app and calls are not handle 
correctly.

> I know my application at times will reach 100 concurrent connections
 > and some times goes has high as 500 connections.

Okay.
Well I do not have actual traffic info down to the sec,
But from the application logs I know that that points in the day more than 300 
calls can come in

> Should I boost minSpareThreads and maxThread values of what I plan to 
> use below? > Or why would we not just set very high minSpareThreads 
> and maxThread values like minSpareThreads =300  and maxThread=1000
>
> This is a snippet of my server.xml
>
>   minSpareThreads="50"
>maxThreads="300"/>
>
>   executor="tomcatPhoneAppThreadPool"
>   compression="on"
>   compressionMinSize="2048"
>   
> compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml"
>   protocol="org.apache.coyote.http11.Http11NioProtocol"
> redirectPort="8443">
>  className="org.apache.coyote.http2.Http2Protocol" />
>
>   
>
> Also, am I good with setting  
> protocol="org.apache.coyote.http11.Http11NioProtocol"
> And then setting  className="org.apache.coyote.http2.Http2Protocol" />
>
> That will tell Tomcat to do HTTP2 Correct?

That's the only way to enable h2. Well... you could use Http11Nio2Protocol, 
too. NIO is the default protocol so you don't even need to add that 
specifically if you don't want to.

Back to threads.

Each thread (unless you go virtual, but that's not really production-ready IMHO 
at this point unless you have very strict circumstances where it will work 
great for you) takes up a bunch of memory, so you can't just set maxThreads=1M. 
Threads take "time" to start, but it's not really that much. If starting and 
stopping threads is what is making your application slow, than you have a very 
high-performance application and environment indeed.

Your question as stated is unanswerable.

You say you are sometimes hitting 500 connections. The default maximum number 
of connections is 1 and you are only using 500. That means you aren't being 
flooded, which is a Good Thing. (BTW: How are you measuring "how many 
connections" you have? Make sure you are measuring the right thing...

I am estimating the actual connections just based on application call logs.

Is your *current* maxThreads set to 500? If so, then your thread pool maximum 
is set to your high-water mark which seems like it should be fine. If you set 
your maxThreads to 1000 you won't get any benefit because only 500 requests are 
ever being sent at once, right?

What else does your application do?
Our application is a sip phone call handling application.(A voice response xml 
application)

For example, if you have a thread-pool max-threads of 1000 and your application 
uses an RDBMS for every request but your db connection pool size is more like 
10, then many threads waiting on a small number of connections gets you 
absolutely no benefit. You'd have to make changes elsewhere in your application 
in order to make use of those extra threads.

Similarly, if you have a big thread pool and a big db connection pool, but your 
database performs slowly, then having all that power on the application server 
doesn't really help you.

Yes our app is using a database  (we use Postres)
And yes I assume that is our bottleneck
Our tomcat context.xml defines that database maxConnction to be only 
maxTotal="20"
We have other apps  and that hit this same database, so we define low maxTotal  
on each  server so each server can have only limit connection access to the 
database
I am thinkingit would be best to try and NOT optimize  minSpareThreads and 
maxThreads but instead to determine what is the optimal
Database  c

performance tunning of Tomcat 10

2024-03-27 Thread Rick Noel
Hello,

I was wondering if the apache foundation has any tools we can use to fine tune 
Tomcat 10.
Tools to deteming how to set the best heap size for Tomcat startup and the best 
connection attributes of minSpareThreads and MaxThreads.

I know my application at times will reach 100 concurrent connections and some 
times goes has high as 500 connections.
Should I boost minSpareThreads and maxThread values of what I plan to use below?

Or why would we not just set very high minSpareThreads and maxThread values
like minSpareThreads =300  and maxThread=1000

This is a snippet of my server.xml



  
   

 

Also, am I good with setting  
protocol="org.apache.coyote.http11.Http11NioProtocol"
And then setting 

That will tell Tomcat to do HTTP2 Correct?

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: Tomcat session replication issue - java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

2024-03-22 Thread Rick Noel
Thank you very much Chris 
The classes my app uses should be serialize anyway so I just go that route.
But thanks for that code snippet too

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz  
Sent: Friday, March 22, 2024 2:36 PM
To: Tomcat Users List ; Rick Noel 

Subject: Re: [EXT]Re: Tomcat session replication issue - 
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

Rick,

On 3/22/24 13:33, Rick Noel wrote:
> I do not want to replicate customer because that class does not 
> implement  serializable
> 
> I was looking for someway that the Manager would NOT try to replicate 
> it
This is an allow-list which is much more secure than a deny-list.

It's a regular expression, so you can feel free to get super-creative with the 
expression if you want to effectively create a deny-list with one item.

Honestly, this is probably some technical dept worth paying off at this point.

Another option would be to store the object in a wrapper in the session that 
*is* serializable but it doesn't actually try to serialize the object it wraps.

I did one of these ages ago for similar reasons: I didn't want to go change all 
those classes to be Serializable. Here it is:

public class TransientObjectWrapper
 implements Serializable
{
 private static final long serialVersionUID = -4694896879363833304L;

 private transient final T _o;

 public TransientObjectWrapper(T o) { _o = o; }

 public T getWrappedObject() { return _o; } }

Using this plus a craftily-written Filter, HttpServletRequestWrapper, and 
HttpSession implementation would allow you to do this kind of thing without any 
failures.

Or you could just configure Tomcat's already flexible allow-list for session 
attribute names.

-chris

> -Original Message-
> From: Mark Thomas 
> Sent: Friday, March 22, 2024 1:27 PM
> To: users@tomcat.apache.org
> Subject: Re: [EXT]Re: Tomcat session replication issue - 
> java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :
> 
> On 22/03/2024 15:43, Rick Noel wrote:
>> Mark,
>>
>> So if my customer object is failing to get set in the session 
>> replication, I could add this to the config snippet?
>>
>> sessionAttributeNameFilter="customer"
> 
> You set that to the attributes you DO want to replicate, not the ones you 
> don't.
> 
> Mark
> 
>>
>> so like this?...
>>
>>
>> >channelSendOptions="6">
>>
>> > className="org.apache.catalina.ha.session.DeltaManager"
>>  expireSessionsOnShutdown="false"
>>  
>> notifyListenersOnReplication="true"
>>  maxActiveSessions="8192"
>> 
>> sessionAttributeNameFilter="customer"
>>  />
>>
>> > className="org.apache.catalina.tribes.group.GroupChannel">
>>   > className="org.apache.catalina.tribes.membership.McastService"
>>   address="228.0.0.4"
>>   port="45564"
>>   frequency="500"
>>   dropTime="3000"/>
>>   > className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>> address="auto"
>> port="5000"
>> selectorTimeout="100"
>> maxThreads="6"/>
>>
>>   > className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
>> > className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
>>   
>>   > className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
>>   > className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
>>

RE: [EXT]Re: Tomcat session replication issue - java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

2024-03-22 Thread Rick Noel
I do not want to replicate customer because that class does not implement  
serializable

I was looking for someway that the Manager would NOT try to replicate it 

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas  
Sent: Friday, March 22, 2024 1:27 PM
To: users@tomcat.apache.org
Subject: Re: [EXT]Re: Tomcat session replication issue - 
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

On 22/03/2024 15:43, Rick Noel wrote:
> Mark,
> 
> So if my customer object is failing to get set in the session 
> replication, I could add this to the config snippet?
> 
> sessionAttributeNameFilter="customer"

You set that to the attributes you DO want to replicate, not the ones you don't.

Mark

> 
> so like this?...
> 
> 
>channelSendOptions="6">
> 
> className="org.apache.catalina.ha.session.DeltaManager"
> expireSessionsOnShutdown="false"
> 
> notifyListenersOnReplication="true"
> maxActiveSessions="8192"
>
> sessionAttributeNameFilter="customer"
> />
> 
> className="org.apache.catalina.tribes.group.GroupChannel">
>   className="org.apache.catalina.tribes.membership.McastService"
>  address="228.0.0.4"
>  port="45564"
>  frequency="500"
>  dropTime="3000"/>
>   className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>address="auto"
>port="5000"
>selectorTimeout="100"
>maxThreads="6"/>
> 
>   className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
> className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
>  
>   className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
>   className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
>   className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
>
> 
>     className="org.apache.catalina.ha.tcp.ReplicationValve"
>   
> filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.htm|.*\.html|.*\.c
> ss|.*\.txt"/>
> 
> 
> className="org.apache.catalina.ha.session.ClusterSessionListener"/>
>   
> 
> 
> 
> 
> 
> Rick Noel
> Systems Programmer | Westwood One
> rn...@westwoodone.com
> 
> -Original Message-
> From: Mark Thomas 
> Sent: Friday, March 22, 2024 11:32 AM
> To: users@tomcat.apache.org
> Subject: [EXT]Re: Tomcat session replication issue - 
> java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :
> 
> On 22/03/2024 15:15, Rick Noel wrote:
>> Is there a way to configure DeltaManager or the Cluster element so it does 
>> not cause my application to throw this error.
>>
>> 22-Mar-2024 10:56:34.382 SEVERE [http-nio-8586-exec-5] 
>> org.apache.catalina.core.StandardWrapperValve.invoke 
>> Servlet.service() for servlet [jsp] in context with path [##0001] 
>> threw exception [An exception occurred processing 
>> [/services/include/properties.jsp] at line [196]
>>
>> 193:
>> 194:session.setAttribute( "format", stationFormat );
>> 195:session.setAttribute( "employee_id", employeeId );
>> 196:session.setAttribute( "customer", customer );
>> 197:session.setAttribute( "customer_id", customerId );
>> 198:se

RE: [EXT]Re: Tomcat session replication issue - java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

2024-03-22 Thread Rick Noel
So setting...   
sessionAttributeNameFilter="customer"
does not work,
 still getting the error  java.lang.IllegalArgumentException: setAttribute: 
Non-serializable attribute : customer

Do I need to set this also?

sessionAttributeValueClassNameFilter= 
"java\\.lang\\.(?:Boolean|Integer|Long|Number|String)|com.radiovoodoo.customer.Customer"

I am thinking no config setting can stop this error.

I am thinking  I must alter my Customer code and make that class implement 
java.io.Serializable.
And that is  what I was hoping not to do. (alter the application code itself)

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Rick Noel
Sent: Friday, March 22, 2024 11:43 AM
To: Tomcat Users List 
Subject: RE: [EXT]Re: Tomcat session replication issue - 
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

Mark,

So if my customer object is failing to get set in the session replication, I 
could add this to the config snippet?

sessionAttributeNameFilter="customer"

so like this?...




  

  




  




  

  


  
     





Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas 
Sent: Friday, March 22, 2024 11:32 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: Tomcat session replication issue - 
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

On 22/03/2024 15:15, Rick Noel wrote:
> Is there a way to configure DeltaManager or the Cluster element so it does 
> not cause my application to throw this error.
>
> 22-Mar-2024 10:56:34.382 SEVERE [http-nio-8586-exec-5]
> org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service()
> for servlet [jsp] in context with path [##0001] threw exception [An
> exception occurred processing [/services/include/properties.jsp] at
> line [196]
>
> 193:
> 194:session.setAttribute( "format", stationFormat );
> 195:session.setAttribute( "employee_id", employeeId );
> 196:session.setAttribute( "customer", customer );
> 197:session.setAttribute( "customer_id", customerId );
> 198:session.setAttribute( "nonidentifier_call_letters", 
> nonIdentifierCallLetters );
> 199:session.setAttribute( "call_letters", callLetters );
>
>
> Stacktrace:] with root cause
> java.lang.IllegalArgumentException: setAttribute:
> Non-serializable attribute [customer]
>
>
> I know why the error, it is because the  customer object was never written to 
> be serialiazable.
> The old application I am working on has a lot of such non serialized
> objects and I do not want to search out change them all to implement
> serialiazable
>
> I am hoping there is a way to configure Tomcat to just not try and
> replication sessions all object which are not serialiazable

https://tomcat.apache.org/tomcat-10.1-doc/config/manager.html

Search for sessionAttributeNameFilter

Mark

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



RE: [EXT]Re: Tomcat session replication issue - java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

2024-03-22 Thread Rick Noel
Mark,

So if my customer object is failing to get set in the session replication,
I could add this to the config snippet?

sessionAttributeNameFilter="customer"

so like this?...




  

  




  




  

  


  
 





Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas 
Sent: Friday, March 22, 2024 11:32 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: Tomcat session replication issue - 
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

On 22/03/2024 15:15, Rick Noel wrote:
> Is there a way to configure DeltaManager or the Cluster element so it does 
> not cause my application to throw this error.
>
> 22-Mar-2024 10:56:34.382 SEVERE [http-nio-8586-exec-5] 
> org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for 
> servlet [jsp] in context with path [##0001] threw exception [An exception 
> occurred processing [/services/include/properties.jsp] at line [196]
>
> 193:
> 194:session.setAttribute( "format", stationFormat );
> 195:session.setAttribute( "employee_id", employeeId );
> 196:session.setAttribute( "customer", customer );
> 197:session.setAttribute( "customer_id", customerId );
> 198:session.setAttribute( "nonidentifier_call_letters", 
> nonIdentifierCallLetters );
> 199:session.setAttribute( "call_letters", callLetters );
>
>
> Stacktrace:] with root cause
> java.lang.IllegalArgumentException: setAttribute: 
> Non-serializable attribute [customer]
>
>
> I know why the error, it is because the  customer object was never written to 
> be serialiazable.
> The old application I am working on has a lot of such non serialized objects 
> and I do not want to search out change them all to implement serialiazable
>
> I am hoping there is a way to configure Tomcat to just not try and 
> replication sessions all object which are not serialiazable

https://tomcat.apache.org/tomcat-10.1-doc/config/manager.html

Search for sessionAttributeNameFilter

Mark

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



Tomcat session replication issue - java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

2024-03-22 Thread Rick Noel
Is there a way to configure DeltaManager or the Cluster element so it does not 
cause my application to throw this error.

22-Mar-2024 10:56:34.382 SEVERE [http-nio-8586-exec-5] 
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for 
servlet [jsp] in context with path [##0001] threw exception [An exception 
occurred processing [/services/include/properties.jsp] at line [196]

193:
194:session.setAttribute( "format", stationFormat );
195:session.setAttribute( "employee_id", employeeId );
196:session.setAttribute( "customer", customer );
197:session.setAttribute( "customer_id", customerId );
198:session.setAttribute( "nonidentifier_call_letters", 
nonIdentifierCallLetters );
199:session.setAttribute( "call_letters", callLetters );


Stacktrace:] with root cause
   java.lang.IllegalArgumentException: setAttribute: 
Non-serializable attribute [customer]


I know why the error, it is because the  customer object was never written to 
be serialiazable.
The old application I am working on has a lot of such non serialized objects 
and I do not want to search out change them all to implement serialiazable

I am hoping there is a way to configure Tomcat to just not try and replication 
sessions all object which are not serialiazable

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: [EXT]Re: Tomcat 10 waning that expireSessionsOnShutdown is not set

2024-03-22 Thread Rick Noel
Thanks Chuck  great link to lots of good stuff

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale 
Sent: Thursday, March 21, 2024 4:00 PM
To: Tomcat Users List 
Subject: [EXT]Re: [EXT]Re: Tomcat 10 waning that expireSessionsOnShutdown is 
not set

[You don't often get email from n82...@gmail.com. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

> On Mar 21, 2024, at 14:50, Rick Noel  wrote:
>
> Do you have a  feel if DeltaManager is better than BackupManager?


Depends on what your needs are. There are some presentations on the subject 
that you might want to look at:
https://tomcat.apache.org/presentations.html

ApacheCon 2018 NA: Deep dive into Tomcat Clustering, Keiichi Fujino

TomcatCon London 2017: Reverse Proxies, Load-Balancing & Clustering, Mark Thomas

  - Chuck

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



RE: [EXT]Re: Tomcat 10 waning that expireSessionsOnShutdown is not set

2024-03-21 Thread Rick Noel
Thank you Chuck

Do you have a  feel if DeltaManager is better than BackupManager?



Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale 
Sent: Thursday, March 21, 2024 3:37 PM
To: Tomcat Users List 
Subject: [EXT]Re: Tomcat 10 waning that expireSessionsOnShutdown is not set

[You don't often get email from n82...@gmail.com. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

> On Mar 21, 2024, at 14:23, Rick Noel  wrote:
>
> Could someone tell me why I would get the below waning about 
> expireSessionsOnShutdown not being set
>
> WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match 
> [Server/Service/Engine/Host/Cluster/Manager] failed to set property 
> [expireSessionsOnShutdown] to [false]
>
> I am using Tomcat 10.1.19 and trying to get clusting set up so session data 
> is not lost because of web app being deployed on two servers and service by a 
> load balancer
>
> Here is my server.xml  snippet...
>
>
> channelSendOptions="6">
>
>className="org.apache.catalina.ha.session.BackupManager"
>
> expireSessionsOnShutdown="false"
>
> notifyListenersOnReplication="true"
>
> mapSendOptions="6"/>


The expireSessionsOnShutdown attribute is only available for the DeltaManager, 
not the BackupManager. See:
https://tomcat.apache.org/tomcat-10.1-doc/config/cluster-manager.html

  - Chuck

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



Tomcat 10 waning that expireSessionsOnShutdown is not set

2024-03-21 Thread Rick Noel
Hello,

Could someone tell me why I would get the below waning about 
expireSessionsOnShutdown not being set

WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match 
[Server/Service/Engine/Host/Cluster/Manager] failed to set property 
[expireSessionsOnShutdown] to [false]

I am using Tomcat 10.1.19 and trying to get clusting set up so session data is 
not lost because of web app being deployed on two servers and service by a load 
balancer

Here is my server.xml  snippet...




   


  

   

   
 
 

 
   
 
 
 
 
   

   



   



And in my application web.xml I have. the needed





Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: 404 for j_security_check

2024-03-19 Thread Rick Noel
Chris,

Thanks for the help, I agree with all your statements.

I now see the  JSESSIONID cookies.

I found a bug in my code. My issue was nothing to do with Tomcat behavior.

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz  
Sent: Sunday, March 17, 2024 10:57 AM
To: users@tomcat.apache.org
Subject: Re: [EXT]Re: 404 for j_security_check

[You don't often get email from ch...@christopherschultz.net. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Rick,

On 3/15/24 13:49, Rick Noel wrote:
>
> I really only want auth once
>
> All hits to jsp pages after a successful login do not trigger the Auth 
> process again.
>
> But hits to java action class servlets do trigger the Auth process
>
> Its  like session data is being lost for some pages but not for others

Can you watch the HTTP headers for your interaction to see what's happening? 
The browser should be sending JSESSIONID cookies with each request. If the 
server isn't sending any Set-Cookie header, the browser should leave things as 
they are.

Please note that Tomcat will send Set-Cookie when a session is created (by 
default, every JSP will create a session IIRC if you declare it to use 
sessions), plus Tomcat will rotate the session identifier as part of the 
authentication process. If you have code on the client that is storing the 
session and using it later, if your session id is being updated during 
authentication you need to make sure it gets updated everywhere the client is 
using it.

> I was thinking maybe this is reason..
>
> The Expires header specifies when content will expire, or how long content is 
> "fresh."
> After this time, the Portal Server will always check back with the remote 
> server to see if the content has changed.
> Most Web servers allow setting an absolute time to expire, a time 
> based on the last time that the client saw the object (last access time), or 
> a time based on the last time the document changed on your server (last 
> modification time).
>
> In JSP, we can set caching to forever using the Expires header like 
> so.
>
> response.setDateHeader("Expires",Long.MAX_VALUE)
>
> BUT I do not want to change my application code, I just want to tell 
> Tomcat 10 to stop Expiring cache so that session log in data is not 
> lost

No, the cache here refers to the client's resource (e.g. page, image,
etc.) cache. It has nothing to do with what's happening on the server.

> My main question is
> I want to know how to configure Tomcat 10 to not loose session data 
> that tells the user has successfully logged in

Are you properly encoding your URLs in your page like with 
HttpServletResponse.encodeURL()? If you are using cookie-based session-tracking 
it probably won't matter, but it's best practice to always do that to ensure 
your URLs are generated properly.

-chris

> -Original Message-
> From: Christopher Schultz 
> Sent: Friday, March 15, 2024 12:19 PM
> To: users@tomcat.apache.org
> Subject: [EXT]Re: 404 for j_security_check
>
> [You don't often get email from ch...@christopherschultz.net. Learn 
> why this is important at https://aka.ms/LearnAboutSenderIdentification 
> ]
>
> Rick,
>
> On 3/14/24 15:37, Rick Noel wrote:
>> After moving from tomcat 9 to tomcat 10 after a user successfully 
>> logs in and then hits a restricted page, the login page is hit again 
>> but on this second login hit I get 404 page not found
> This is actually expected, since j_security_check is only supposed to be used 
> when the container (Tomcat) interrupts a user workflow to request 
> authentication.
>
>> How do I set the correct path in my  login jsp so that 
>> j_security_check is found?
>>
>> BTW  I actually am wondering why a  successful logged on user would 
>> even be sent to the log in page again?
> That's more of a question for your application than anything else.
>
>> My login page  is ->   /membership/login.jsp
>>
>> Here is how I set the path to  j_security_check in above login.jsp
>>
>> 
>>
>> My restricted  web.xml snippet
>
> Are you doing what I call a "direct login" where you have a "login page"
> that most users hit first. Like from example.com/app/ where there is no 
> initial request for a protected resource? Or are your users always (1) 
> requesting a protected resource then (2) Tomcat requests authentication then 
> (3) the user is forwarded to the resource originally requested in (1)?
>
>> 
>> 
>> External
>> /external/*
>> 
>> 
>> radiovoodoo
>&g

RE: [EXT]Re: 404 for j_security_check

2024-03-15 Thread Rick Noel


I really only want auth once

All hits to jsp pages after a successful login do not trigger the Auth process 
again.

But hits to java action class servlets do trigger the Auth process

Its  like session data is being lost for some pages but not for others

I was thinking maybe this is reason..


The Expires header specifies when content will expire, or how long content is 
"fresh."
After this time, the Portal Server will always check back with the remote 
server to see if the content has changed.
Most Web servers allow setting an absolute time to expire, a time based on the 
last time that the client saw the object (last access time),
or a time based on the last time the document changed on your server (last 
modification time).

In JSP, we can set caching to forever using the Expires header like so.

response.setDateHeader("Expires",Long.MAX_VALUE)

BUT I do not want to change my application code, I just want to tell Tomcat 10 
to stop
Expiring cache so that session log in data is not lost

My main question is  
I want to know how to configure Tomcat 10 to not loose session data that tells 
the user has successfully logged in




Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Christopher Schultz  
Sent: Friday, March 15, 2024 12:19 PM
To: users@tomcat.apache.org
Subject: [EXT]Re: 404 for j_security_check

[You don't often get email from ch...@christopherschultz.net. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Rick,

On 3/14/24 15:37, Rick Noel wrote:
> After moving from tomcat 9 to tomcat 10 after a user successfully logs 
> in and then hits a restricted page, the login page is hit again but on 
> this second login hit I get 404 page not found
This is actually expected, since j_security_check is only supposed to be used 
when the container (Tomcat) interrupts a user workflow to request 
authentication.

> How do I set the correct path in my  login jsp so that 
> j_security_check is found?
>
> BTW  I actually am wondering why a  successful logged on user would 
> even be sent to the log in page again?
That's more of a question for your application than anything else.

> My login page  is ->   /membership/login.jsp
>
> Here is how I set the path to  j_security_check in above login.jsp
>
> 
>
> My restricted  web.xml snippet

Are you doing what I call a "direct login" where you have a "login page"
that most users hit first. Like from example.com/app/ where there is no initial 
request for a protected resource? Or are your users always (1) requesting a 
protected resource then (2) Tomcat requests authentication then (3) the user is 
forwarded to the resource originally requested in (1)?

> 
> 
> External
> /external/*
> 
> 
> radiovoodoo
> 
> 
> NONE
> 
> 
> 
> 
> Auth
> /auth/*
> 
> 
> radiovoodoo
> 
> 
> NONE
> 
> 
> 
> FORM
> 
> /membership/login.jsp
> /membership/error.jsp
> 
> 

Those NONE lines look weird to me. 
Why are you explicitly specifying those? What part of your configuration 
actually requests authentication and authorization?

-chris

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



404 for j_security_check

2024-03-14 Thread Rick Noel
After moving from tomcat 9 to tomcat 10after a user successfully logs in 
and then hits a restricted page,  the login page is hit again but on  this 
second login hit I get 404 page not found

How do I set the correct path in my  login jsp so that   j_security_check is 
found?

BTW  I actually am wondering why a  successful logged on user would even be 
sent to the log in page again?


My login page  is ->   /membership/login.jsp

Here is how I set the path to  j_security_check in above login.jsp



My restricted  web.xml snippet




External
/external/*


radiovoodoo


NONE




Auth
/auth/*


radiovoodoo


NONE



FORM

/membership/login.jsp
/membership/error.jsp











Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



RE: [EXT]Re: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

2024-02-09 Thread Rick Noel
Thank you so much Mark for working with me on this issue!
I am taking your recommendation to create a   webapps-javaee directory and 
place my Tomcat 9 running war file into
that dir so that Tomcat does the compile correctly.

Only problem is that now I cannot figure out what is the correct URL path to my 
servlet!

When I place the .war, the old way with the .war  being in  
webapps/transaction,my tomcat cat log says...

Deploying web application directory [C:\apache-tomcat-9.0.73\webapps\transaction
And I see my application at 
C:\apache-tomcat-9.0.73\webapps\transaction\ROOT##0001

And I can hit my servlet via...

http://localhost:8588/XmlRpc

BUT when I place my .war in webapps-javaee\transaction the tomcat cat log 
says..

Deploying web application directory 
[C:\apache-tomcat-10.1.18\webapps-javaee\transaction\transaction

And I cannot hit either..

http://localhost:8588/XmlRpc 
or
http://localhost:8588/transaction/XmlRpc


The creation of the 
C:\apache-tomcat-10.1.18\webapps-javaee\transaction\transaction  directory is 
baffling me
See attached file

I expect only to see the creation of a 
C:\apache-tomcat-10.1.18\webapps-javaee\transaction\ROOT##0001 directory.
That is where I believe my application to be

Here is how I have my context defined in server.xml..



Is my server.xml wrong?
When I place my .war in   webapps-javaee\transaction   dir?




-Original Message-
From: Mark Thomas  
Sent: Thursday, February 8, 2024 5:45 PM
To: users@tomcat.apache.org
Subject: Re: [EXT]Re: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

[You don't often get email from ma...@apache.org. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

Confirmed this is user error. There is no bug in the migration tool.

Steps to demonstrate this:

- Create new, blank Eclipse dynamic web project
- Add provided servlet code
- Add required libraries
- Remove referenced to internal logging code
- Add web.xml with basic mapping to "/test"
- Export WAR file
- Deploy to Tomcat
- Start Tomcat
- Request servlet

Servlet loads and then reports an exception during init. That is fine.
It proves that the servlet was loaded which is all we care about at this point.

- Use migration tool to migrate WAR
- Deploy migrated WAR to Tomcat 10.1.x
- Start Tomcat
- Request servlet

Servlet loads and then reports an exception during init. Again, this is fine as 
it proves that the Servlet has been converted correctly and can be loaded by 
Tomcat 10.1.x.

Best guess, the Eclipse project isn't configured correctly to compile the web 
application for Tomcat 10.1.x.

At this point the simplest solution is likely to be:

- take the WAR file that works on Tomcat 9
- drop in webapps-javaee in Tomcat 10 and let Tomcat convert it
   automatically

Mark


On 08/02/2024 20:28, Rick Noel wrote:
> No I cannot compile from command line.
>
> But I do not really care how eclipse compiles my class anyway.
> All I know is that eclipse compiles the class without errors. Using 
> the jars I tell it to. (all the jars run through the migration tool) But 
> Tomcat 10 can not compile the class using those same migrated jar files.
>
> And my class has no use of javax.server  classes in it.
> All the javax.server classes are only in the third part jar files 
> which are supposed to have been converted to use  jakarta.server 
> classes
>
> Is this not a bug with Tomcat migration tool?
>
> Again here is my class that does not compile on Tomcat 10...
> It has no reference to  javax.server
>
>
> package com.radiovoodoo.xmlrpc;
>
> import java.io.IOException;
> import java.net.MalformedURLException; import java.net.URL;
>
> import org.apache.xmlrpc.XmlRpcException;
> import org.apache.xmlrpc.XmlRpcRequest; import 
> org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.Authenticati
> onHandler; import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
> import org.apache.xmlrpc.server.PropertyHandlerMapping;
> import org.apache.xmlrpc.webserver.XmlRpcServlet;
>
> import com.radiovoodoo.util.Log;
>
> /**
>   * @(#)RVXmlRpcServlet.java
>   *
>   * new XmlRpcServlet, which extends the default Apache XmlRpcServlet
>   *
>   * @author  Hank Zill 
>   * @version 1.0
>   *
>   * Copyright(c) 2005 RadioVoodoo, Inc. All Rights Reserved.
>   */
>
> public class RVXmlRpcServlet
> extends XmlRpcServlet
> {
> /**
>  *  this init parameter defines the path to the property file from
>  *  which to load the XML RPC handler mappings.
>  *
>  *  the path is relative to the CLASSPATH
>  */
> public static final String RESOURCE_PATH = "property-file-path";
>
> protected XmlRpcHandlerMapping newXmlRpcHandlerMapping()
>throws XmlRpcException
> {
>PropertyHandlerMapping mapping

RE: [EXT]Re: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

2024-02-08 Thread Rick Noel
No I cannot compile from command line.

But I do not really care how eclipse compiles my class anyway.
All I know is that eclipse compiles the class without errors. Using the jars I 
tell it to. (all the jars run through the migration tool)
But Tomcat 10 can not compile the class using those same migrated jar files.

And my class has no use of javax.server  classes in it.
All the javax.server classes are only in the third part jar files which are 
supposed to have been converted to use  jakarta.server classes

Is this not a bug with Tomcat migration tool?

Again here is my class that does not compile on Tomcat 10...
It has no reference to  javax.server


package com.radiovoodoo.xmlrpc;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.XmlRpcRequest;
import 
org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler;
import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.webserver.XmlRpcServlet;

import com.radiovoodoo.util.Log;

/**
 * @(#)RVXmlRpcServlet.java
 *
 * new XmlRpcServlet, which extends the default Apache XmlRpcServlet
 *
 * @author  Hank Zill 
 * @version 1.0
 *
 * Copyright(c) 2005 RadioVoodoo, Inc. All Rights Reserved.
 */

public class RVXmlRpcServlet
   extends XmlRpcServlet
{
   /**
*  this init parameter defines the path to the property file from
*  which to load the XML RPC handler mappings.
*
*  the path is relative to the CLASSPATH  
*/
   public static final String RESOURCE_PATH = "property-file-path";

   protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() 
  throws XmlRpcException
   {
  PropertyHandlerMapping mapping = null;

  /* String resourcePath = getInitParameter( RESOURCE_PATH );
  
  if ( resourcePath == null )
  {
 throw new XmlRpcException( "No property file defined.  This servlet 
must have the init-param " + RESOURCE_PATH + " set." );
  } */
  String resourcePath = "somefile.properties";

  URL url = null;
  try {
url = getServletContext().getResource( resourcePath );
  } catch (MalformedURLException e1) {
throw new XmlRpcException( resourcePath + " " + e1 );
  }

  if (url == null) 
  {
 throw new XmlRpcException("Failed to locate resource " + resourcePath 
);
  }
  try 
  {
 mapping = newPropertyHandlerMapping(url);
  } 
  catch (IOException e) 
  {
 throw new XmlRpcException("Failed to load resource " + url + ": " + 
e.getMessage(), e);
  }

  if ( mapping == null )
 Log.debug( "HandlerMapping is null" );
  else
  {
 String[] methods = mapping.getListMethods();

 for ( int x = 0; x < methods.length; x++ )
 {
Log.debug( "method: " + methods[x] );
 }
  }
  
  mapping.setAuthenticationHandler(new AuthenticationHandler() {
//rick removed override annotaion so this class will compile on java 1.5
//@Override
public boolean isAuthorized(XmlRpcRequest arg0) throws 
XmlRpcException {
    return true;
}
  });

  return mapping;
   }
}





Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Rob Sargent  
Sent: Thursday, February 8, 2024 1:54 PM
To: Tomcat Users List 
Subject: [EXT]Re: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

[You don't often get email from rsarg...@xmission.com. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

> On Feb 8, 2024, at 9:04 AM, Rick Noel  wrote:
>
> I built  my app in Eclipse  and the build path is set to use the migrated 
> jar.
> It compiles without error on Eclipse and using the migrated jar.  I 
> have that same migrated jar in the Tomcat lib But when tomcat 10 
> compiles it does not compile
>
> I have also used the migration tool on my .war that runs in Tomcat 9 and that 
> war still fails with same compile error.
>
> So to summarize. the migration tool fails to convert third 
> party jar xmlrpc-server3.1.3.jar And it also fails when I use it on my .war 
> ran through the migration tool.
>
>
> Rick Noel
> Systems Programmer | Westwood One
> rn...@westwoodone.com
>

Can you build from the command  line?  Who knows what eclipse does under the 
covers
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

CAUTION: This email originated from outside of the organization. Do not click 
links or 

RE: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

2024-02-08 Thread Rick Noel
I built  my app in Eclipse  and the build path is set to use the migrated jar.
It compiles without error on Eclipse and using the migrated jar.  I have that 
same migrated jar in the Tomcat lib
But when tomcat 10 compiles it does not compile

I have also used the migration tool on my .war that runs in Tomcat 9 and that 
war still fails with same compile error.

So to summarize. the migration tool fails to convert third party jar 
xmlrpc-server3.1.3.jar
And it also fails when I use it on my .war ran through the migration tool.


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas  
Sent: Thursday, February 8, 2024 9:48 AM
To: users@tomcat.apache.org
Subject: Re: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

[You don't often get email from ma...@apache.org. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

On 08/02/2024 14:38, Rick Noel wrote:
> My code uses no javax.server  code other that what is in the third party jar.

Then you need to fix your build system that is compiling your code against the 
original xmlrpc-server3.1.3.jar rather than the migrated version.

> Is it not the third part jar that needs to stop using javax.server ?

No. It is the compiled form of your code that has the issue.

When you compile your class it retains a reference to the version of 
org.apache.xmlrpc.webserver.XmlRpcServlet that it was compiled against.
You can't just swap the xmlrpc-server3.1.3.jar at runtime. You have to use the 
migrated JAR at compile time as well.

Mark


>
> Where in my code does it use javax.server, other than from classes in package 
> org.apache.xmlrpc?
>
> package com.radiovoodoo.xmlrpc;
>
> import java.io.IOException;
> import java.net.MalformedURLException; import java.net.URL;
>
> import org.apache.xmlrpc.XmlRpcException;
> import org.apache.xmlrpc.XmlRpcRequest; import 
> org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.Authenticati
> onHandler; import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
> import org.apache.xmlrpc.server.PropertyHandlerMapping;
> import org.apache.xmlrpc.webserver.XmlRpcServlet;
>
> import com.radiovoodoo.util.Log;
>
> /**
>   * @(#)RVXmlRpcServlet.java
>   *
>   * new XmlRpcServlet, which extends the default Apache XmlRpcServlet
>   *
>   * @author  Hank Zill 
>   * @version 1.0
>   *
>   * Copyright(c) 2005 RadioVoodoo, Inc. All Rights Reserved.
>   */
>
> public class RVXmlRpcServlet
> extends XmlRpcServlet
> {
> /**
>  *  this init parameter defines the path to the property file from
>  *  which to load the XML RPC handler mappings.
>  *
>  *  the path is relative to the CLASSPATH
>  */
> public static final String RESOURCE_PATH = "property-file-path";
>
> protected XmlRpcHandlerMapping newXmlRpcHandlerMapping()
>throws XmlRpcException
> {
>PropertyHandlerMapping mapping = null;
>
>/* String resourcePath = getInitParameter( RESOURCE_PATH );
>
>if ( resourcePath == null )
>{
>   throw new XmlRpcException( "No property file defined.  This servlet 
> must have the init-param " + RESOURCE_PATH + " set." );
>} */
>String resourcePath = "/WEB-INF/somefile";
>
>URL url = null;
> try {
>   url = getServletContext().getResource( resourcePath );
> } catch (MalformedURLException e1) {
>   throw new XmlRpcException( resourcePath + " " + e1 );
> }
>
>if (url == null)
>{
>   throw new XmlRpcException("Failed to locate resource " + 
> resourcePath );
>}
>try
>{
>   mapping = newPropertyHandlerMapping(url);
>}
>catch (IOException e)
>{
>   throw new XmlRpcException("Failed to load resource " + url + ": " + 
> e.getMessage(), e);
>}
>
>if ( mapping == null )
>   Log.debug( "HandlerMapping is null" );
>else
>{
>   String[] methods = mapping.getListMethods();
>
>   for ( int x = 0; x < methods.length; x++ )
>   {
>  Log.debug( "method: " + methods[x] );
>   }
>}
>
>mapping.setAuthenticationHandler(new AuthenticationHandler() {
>  //rick removed override annotaion so this class will compile on java 
> 1.5
>   //@Override
>   public boolean isAuthorized(XmlRpcRequest arg0) throws 
> XmlRpcException {
>   return true;
>   }
>});
>
>  

RE: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

2024-02-08 Thread Rick Noel
My code uses no javax.server  code other that what is in the third party jar.
Is it not the third part jar that needs to stop using javax.server ? 

Where in my code does it use javax.server, other than from classes in package 
org.apache.xmlrpc?

package com.radiovoodoo.xmlrpc;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.XmlRpcRequest;
import 
org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler;
import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.webserver.XmlRpcServlet;

import com.radiovoodoo.util.Log;

/**
 * @(#)RVXmlRpcServlet.java
 *
 * new XmlRpcServlet, which extends the default Apache XmlRpcServlet
 *
 * @author  Hank Zill 
 * @version 1.0
 *
 * Copyright(c) 2005 RadioVoodoo, Inc. All Rights Reserved.
 */

public class RVXmlRpcServlet
   extends XmlRpcServlet
{
   /**
*  this init parameter defines the path to the property file from
*  which to load the XML RPC handler mappings.
*
*  the path is relative to the CLASSPATH  
*/
   public static final String RESOURCE_PATH = "property-file-path";

   protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() 
  throws XmlRpcException
   {
  PropertyHandlerMapping mapping = null;

  /* String resourcePath = getInitParameter( RESOURCE_PATH );
  
  if ( resourcePath == null )
  {
 throw new XmlRpcException( "No property file defined.  This servlet 
must have the init-param " + RESOURCE_PATH + " set." );
  } */
  String resourcePath = "/WEB-INF/somefile";

  URL url = null;
  try {
url = getServletContext().getResource( resourcePath );
  } catch (MalformedURLException e1) {
throw new XmlRpcException( resourcePath + " " + e1 );
  }

  if (url == null) 
  {
 throw new XmlRpcException("Failed to locate resource " + resourcePath 
);
  }
  try 
  {
 mapping = newPropertyHandlerMapping(url);
  } 
  catch (IOException e) 
  {
 throw new XmlRpcException("Failed to load resource " + url + ": " + 
e.getMessage(), e);
  }

  if ( mapping == null )
 Log.debug( "HandlerMapping is null" );
  else
  {
 String[] methods = mapping.getListMethods();

 for ( int x = 0; x < methods.length; x++ )
 {
Log.debug( "method: " + methods[x] );
 }
  }
  
  mapping.setAuthenticationHandler(new AuthenticationHandler() {
//rick removed override annotaion so this class will compile on java 1.5
//@Override
public boolean isAuthorized(XmlRpcRequest arg0) throws 
XmlRpcException {
    return true;
}
  });

  return mapping;
   }
}
Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas  
Sent: Thursday, February 8, 2024 9:27 AM
To: users@tomcat.apache.org
Subject: Re: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

[You don't often get email from ma...@apache.org. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

On 08/02/2024 14:17, Rick Noel wrote:
> My class is RVXmlRpcServlet and below is the compile error that 
> happens when I use the xmlrpc-server3.1.3.jar after that jar has been 
> run through  the migration tool jakartaee-migration-1.0.7
>
> That same class throws NO compile error on Tomcat 9 using 
> xmlrpc-server3.1.3.jar
>
> Here is the compile error

The bug is your code. You need up update RVXmlRpcServlet to use 
jakarta.servlet.Servlet rather than javax.servlet.Servlet

Ditto for any other Java EE classes you have referenced in your code.

If you want your application to work with Tomcat 9 and Tomcat 10 I suggest you:

- write it for Tomcat 9
- package it as a WAR file
- process the entire WAR file with the migration tool
- use original WAR file with Tomcat 9 and the migrated WAR file with
   Tomcat 10+

Mark

>
> 06-Feb-2024 15:48:53.044 SEVERE [http-nio-8588-exec-1] 
> org.apache.catalina.core.StandardWrapperValve.invoke Allocate exception for 
> servlet [XmlRpcServlet]
>   java.lang.ClassCastException: class 
> com.radiovoodoo.xmlrpc.RVXmlRpcServlet cannot be cast to class 
> jakarta.servlet.Servlet (com.radiovoodoo.xmlrpc.RVXmlRpcServlet is in unnamed 
> module of loader org.apache.catalina.loader.ParallelWebappClassLoader 
> @568750b7; jakarta.servlet.Servlet is in unnamed module of loader 
> java.net.URLClassLoader @18769467)
>   at 
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:865)
> 

RE: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

2024-02-08 Thread Rick Noel
My class is RVXmlRpcServlet and below is the compile error that happens when I 
use the xmlrpc-server3.1.3.jar after that jar has been run through  the 
migration tool jakartaee-migration-1.0.7

That same class throws NO compile error on Tomcat 9 using xmlrpc-server3.1.3.jar

Here is the compile error

06-Feb-2024 15:48:53.044 SEVERE [http-nio-8588-exec-1] 
org.apache.catalina.core.StandardWrapperValve.invoke Allocate exception for 
servlet [XmlRpcServlet]
java.lang.ClassCastException: class 
com.radiovoodoo.xmlrpc.RVXmlRpcServlet cannot be cast to class 
jakarta.servlet.Servlet (com.radiovoodoo.xmlrpc.RVXmlRpcServlet is in unnamed 
module of loader org.apache.catalina.loader.ParallelWebappClassLoader 
@568750b7; jakarta.servlet.Servlet is in unnamed module of loader 
java.net.URLClassLoader @18769467)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:865)
at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:649)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:115)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340)
at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)
at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
at 
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at 
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:833)


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Mark Thomas  
Sent: Thursday, February 8, 2024 8:54 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

[You don't often get email from ma...@apache.org. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

On 08/02/2024 13:45, Rick Noel wrote:
> Our application uses classes in this jar xmlrpc-server3.1.3.jar .(it is 
> the latest version)
>
> We are trying to migrate to Tomcat 10 but that  jar uses the   javax.server. 
> package classes instead of the needed  jakarta.server. pacakage.
>
>
> I have tried running this jar trough the latest Tomcat 10 migration 
> tool (jakartaee-migration-1.0.7) which is suppose to alter the jar to 
> make all classes use  jakarta.server.  classes
>
> but the tool is not fully converting all the classes,  since I still get 
> compile errors at run time.

Please provide details of the compilation errors that you see.

> I think in addition to not using  javax.server.  the jar should use 
> this class
>
> java.net.URI  instead of   java.net.URL

That seems ... unlikely.

> anyone have ideas on how to make xmlrpc-server3.1.3.jar  tomcat 10 compliant?

I'd be surprised if the migration tool didn't process a JAR that old correctly.

Mark


> BTW the jar in question has classes in this package
> org.apache.xmlrpc.
>
> Rick Noel
> Systems Programmer | Westwood One
> rn...@westwoodone.com
>
>

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



jakartaee-migration-1.0.7 migration tool failure

2024-02-08 Thread Rick Noel
Our application uses classes in this jar xmlrpc-server3.1.3.jar .(it is the 
latest version)

We are trying to migrate to Tomcat 10 but that  jar uses the   javax.server. 
package classes instead of the needed  jakarta.server. pacakage.


I have tried running this jar trough the latest Tomcat 10 migration tool 
(jakartaee-migration-1.0.7) which is suppose to alter the jar to make all 
classes use  jakarta.server.  classes

but the tool is not fully converting all the classes,  since I still get 
compile errors at run time.


I think in addition to not using  javax.server.  the jar should use this class

java.net.URI  instead of   java.net.URL


anyone have ideas on how to make xmlrpc-server3.1.3.jar  tomcat 10 compliant?

BTW the jar in question has classes in this package
org.apache.xmlrpc.

Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com