Re: Problem with ServletContext replication

2017-03-01 Thread Keiichi Fujino
Hi.

This seems to ReplicatedContext's bug.
In the current code, the class loader is passed to ReplicationMap as Null.
It is necessary to call super.startInternal() before initializing the
ReplicationMap.

Please open bugzilla.

2017-03-02 10:15 GMT+09:00 Andrew Gillett :

> Environment:
>   Apache Tomcat 8.5.11
>   OpenJDK Runtime Environment (build 1.8.0_121-b13)
>
> Hi,
>
> I am trying to run a two node Tomcat cluster (server1 & server2) with
> an Apache load balancer.
> I require both Session and Context replication.
>
> I've had no trouble getting Session replication to work using
> SimpleTcpCluster, however I've been unable to get the Context
> replication to work.
>
> I have the following config in META-INF/context.xml:
> 
>
> and in WEB-INF/web.xml:
> 
>
> When I place an object in the server1 ServletContext I see the
> following error on server2:
>
> 02-Mar-2017 11:31:28.088 SEVERE
> [Tribes-Task-Receiver[Catalina-Channel]-3]
> org.apache.catalina.tribes.tipis.AbstractReplicatedMap.messageReceived
> Unable to deserialize MapMessage.
>  java.lang.ClassNotFoundException: com.pharmhos.merlin.jaas.AdUser
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:348)
> at java.io.ObjectInputStream.resolveClass(
> ObjectInputStream.java:677)
> at org.apache.catalina.tribes.io.ReplicationStream.resolveClass(
> ReplicationStream.java:79)
> at java.io.ObjectInputStream.readNonProxyDesc(
> ObjectInputStream.java:1819)
> at java.io.ObjectInputStream.readClassDesc(
> ObjectInputStream.java:1713)
> at java.io.ObjectInputStream.readOrdinaryObject(
> ObjectInputStream.java:1986)
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.
> java:1535)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.
> java:422)
> at org.apache.catalina.tribes.io.XByteBuffer.deserialize(
> XByteBuffer.java:558)
> at org.apache.catalina.tribes.tipis.AbstractReplicatedMap$
> MapMessage.value(AbstractReplicatedMap.java:1504)
> at org.apache.catalina.tribes.tipis.AbstractReplicatedMap$
> MapMessage.deserialize(AbstractReplicatedMap.java:1462)
> at org.apache.catalina.tribes.tipis.AbstractReplicatedMap.
> messageReceived(AbstractReplicatedMap.java:649)
> at org.apache.catalina.tribes.group.GroupChannel.
> messageReceived(GroupChannel.java:300)
> at org.apache.catalina.tribes.group.ChannelInterceptorBase.
> messageReceived(ChannelInterceptorBase.java:83)
> at org.apache.catalina.tribes.group.ChannelInterceptorBase.
> messageReceived(ChannelInterceptorBase.java:83)
> at org.apache.catalina.tribes.group.interceptors.
> TcpFailureDetector.messageReceived(TcpFailureDetector.java:116)
> at org.apache.catalina.tribes.group.ChannelInterceptorBase.
> messageReceived(ChannelInterceptorBase.java:83)
> at org.apache.catalina.tribes.group.ChannelCoordinator.
> messageReceived(ChannelCoordinator.java:276)
> at org.apache.catalina.tribes.transport.ReceiverBase.
> messageDataReceived(ReceiverBase.java:244)
> at org.apache.catalina.tribes.transport.nio.NioReplicationTask.
> drainChannel(NioReplicationTask.java:213)
> at org.apache.catalina.tribes.transport.nio.
> NioReplicationTask.run(NioReplicationTask.java:101)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
> It appears that my AdUser object is being serialized on server1 but is
> not being deserialized on server2.
>
> The "AdUser" class exists within the web application under
> WEB-INF/classes but it looks like the
> org.apache.catalina.tribes.io.ReplicationStream is not using the right
> class loader for the web app.
>
> I don't know if this is a configuration error, tomcat bug, or
> something else.  Any suggestions on how to diagnose or resolve this
> issue will be gratefully received.
>
>
> Andrew gillett
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
> --
> Keiichi.Fujino
> 




Re: Adding/Exposing a custom module/service as part of the tomcat

2017-03-01 Thread Daga, Harshit
Hi,

Thanks Christopher for JMX option but it is taking more time.

Use case :
I have two tomcat servers (s1 and s2). I will call a method in s1 server from 
external source. On the method invocation s1 contacts s2 and passes on the 
information (example some in-memory data stored for the s1 is passed on to s2).

If I use JMX, it is takes time to connect to server1 and fetch the information 
and then connects to server2 and update the information.

What I am looking for is to create light service and expose to some port (let 
say 8100). Now if I call this service on s1 (from outside) the s1 should 
connect the s2 and pass on the information.

Kindly provide me some suggestion on how I can do this.


Thanks & Regards,
HD


On February 19, 2017 at 8:50:46 AM, Christopher Schultz 
(ch...@christopherschultz.net) wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Harshit,

On 2/18/17 8:12 PM, Daga, Harshit wrote:
> Hi,
>
> I want to add a custom service/module as part of the tomcat server
> which should start as part of tomcat startup.
>
> Service : I want to expose a service as part of tomcat startup
> which can store all the active sessions for the application
> running on the server and when I call this service via RMI or HTTP
> (can expose anyhow) I get this information. This service will be
> used by other tomcat servers to know the information. Usage :
> tomcat_1 calls tomcat_2 (on a specific port at which service is
> exposed) for the given end point, let say, getListOfSessions and
> this will return the list.
>
> I want to know suggestion for implementing/exposing/configuring
> such a service/module.
>
> PS : I want to do this as part of tomcat service to keep changes
> transparent of application.

Why not just use the existing JMX beans to get that information? I
don't think you have to write anything new.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYqaKjAAoJEBzwKT+lPKRYny8P/30C0NKWPClWwO9nYEM450OP
WtWYqqSv6REwNyS5DArGBa1WzTPKAZyqu4Ae5CE4PqlXxRwiWyUkwDBxQU7YwXXi
6YA3sThhWxNPzB03CFExEUsupKG76Td+RaiZ9T9fCsvYMKbLWBcrGTL2ZM53wnzb
XiKuOGcTb3IpmZlBDYcY/top4yvx1gF1bGvOmODKvDU8AuS7mMXqVhtcABB5BVPC
1yyeQ+AkdFveR+rq7tC7HlGUj4CD11zunGKIk/biNxfQFhGW0Xr+KA4fTabARZJd
Unnpo3PF23L/QWsc+Ibv6hna117z19KFnEzuy3NSgdHJLLXDGTWodactuj1EhJ0+
qKu3y8apIEEvyNoOLH9aMM4KhIK5HDACzF+LEqpivVMQ1yj5jhNs39RNfFjXjXgr
yAStlm8CWfEdEUiEo/QNODMarK71eKdYQPCU20qGls37SaauPJKerAf/FCtLp39/
ogLTMxQFTpI+b8ScO1XUE60Gq7m1uWz6HvTH4TZFO7xX7PBAPNau7+ovfsrQAbRC
PZUpC/G4SZv8tDxptsn845b3cMe2+mJYA37wDQI2OyXSf5qd/ZaE1vgQNktqToCg
mB+rN8cTFkaXlLulCLE2xIZXGrecy4/UkwHCR9g/OPKJWS7LrsRA5B+xiafNp/an
oAgaj1r/5qM8DxHAz6Fh
=ox2w
-END PGP SIGNATURE-

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



Problem with ServletContext replication

2017-03-01 Thread Andrew Gillett
Environment:
  Apache Tomcat 8.5.11
  OpenJDK Runtime Environment (build 1.8.0_121-b13)

Hi,

I am trying to run a two node Tomcat cluster (server1 & server2) with
an Apache load balancer.
I require both Session and Context replication.

I've had no trouble getting Session replication to work using
SimpleTcpCluster, however I've been unable to get the Context
replication to work.

I have the following config in META-INF/context.xml:


and in WEB-INF/web.xml:


When I place an object in the server1 ServletContext I see the
following error on server2:

02-Mar-2017 11:31:28.088 SEVERE
[Tribes-Task-Receiver[Catalina-Channel]-3]
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.messageReceived
Unable to deserialize MapMessage.
 java.lang.ClassNotFoundException: com.pharmhos.merlin.jaas.AdUser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:677)
at 
org.apache.catalina.tribes.io.ReplicationStream.resolveClass(ReplicationStream.java:79)
at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1819)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1986)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at 
org.apache.catalina.tribes.io.XByteBuffer.deserialize(XByteBuffer.java:558)
at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap$MapMessage.value(AbstractReplicatedMap.java:1504)
at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap$MapMessage.deserialize(AbstractReplicatedMap.java:1462)
at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.messageReceived(AbstractReplicatedMap.java:649)
at 
org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:300)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:83)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:83)
at 
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:116)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:83)
at 
org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:276)
at 
org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:244)
at 
org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:213)
at 
org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:101)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

It appears that my AdUser object is being serialized on server1 but is
not being deserialized on server2.

The "AdUser" class exists within the web application under
WEB-INF/classes but it looks like the
org.apache.catalina.tribes.io.ReplicationStream is not using the right
class loader for the web app.

I don't know if this is a configuration error, tomcat bug, or
something else.  Any suggestions on how to diagnose or resolve this
issue will be gratefully received.


Andrew gillett

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



logging.properties vs catalina.properties

2017-03-01 Thread John Zhuge
Hi Tomcat gurus,

Do you know which file is loaded first? e.g. in 6.0.48.
I guess logging.properties is loaded first, does it mean it should not use
any system property defined in catalina.properties?

Thanks,
-- 
John