how to achieve session replication in jboss 7 - jboss

I have made two standalone jboss 7 instances and I am able to load balance them using mod_jk.
Now, I would like to implement session replication in my app.
I have searched the internet and found that adding <distributable/> tag to web.xml would enable the session replication. Unfortunately, it is not working for me.
For instance: If I start both my jboss instances, run my application and shutdown the instance where session is created, the second node(instance) creates a new session.
As a result, the session data is lost and I have to log again into my application.
Could any one please explain to me the configuration that is required in jboss 7 for session replication to work ?

Related

example of infinispan domain configuration

I'm trying to deploy an infinisppan cluster (2 machines) using the domain mode. But I can't find any working example of domain.xml and host.xml config file.
This cluster would be used by keycloak as a cache server
Any luck one of you already work on this ?
You need to download infinispan 9.4.14 (or any 9.4) and start the bin/domain.sh [bat] script.
That's it you have a running domain with two servers.
If you want to add a second machine you need to copy the server and start the domain script by passing "--host-config=host-slave.xml" also you need to set "jboss.domain.master.address=" with "-D" to let the process know where the domain master is.
Anothe option is to move host-slave.xml-->host.xml and edit the domain-controller discovery-options.
More information can be found here -> http://infinispan.org/docs/stable/server_guide/server_guide.html#domain_mode

Load properties into application based on Weblogic managed server

I have this requirement - I have several managed servers running on my Weblogic (version 12.x). There are multiple machines as well.
Machine 1: Managed server 1, 2
Machine 2: Managed server 3, 4
I have a spring-boot based application (war) that is deployed across all managed servers. It has both an MDB (to read messages from JMS queue), and a SOAP Webservice.
The queue that it is reading messages from is however targeted/deployed only on a few managed servers - 1 and 3.
Now, I don't want my application to fail or start complaining when it doesn't find the queue on managed servers 2 and 4. Hence, I wish to load my MDB based on a property/configuration specific to managed server.
Is there any way to achieve this?
You could add a custom System property to the server start parameters of server 2 and 4 in the admin console, ie: "-DignoreMDB=1" and read that using a System.getProperty("ignoreMDB") != null call. Note that you need to restart the nodemanager first and your managed servers second to get modification to the server start parameters active.

OpenLDAP CentOS7 rejects authenication sometimes

I try to setup an OpenLDAP-Server that I can use as backend for a WebSSO (LemonLDAP::NG). This specific WebSSO allows to store the sessions inside the LDAP backend.
My problem is that it seems that whenever I connect to the LDAP backend to store session data ~1 out of 10 times it works, the other times LDAP rejects the authentication.
Logs for failed attempts and for successful attempts can be found here
As you can see the maker of LemonLDAP::NG thinks the error is within OpenLDAP (or my configuration of OpenLDAP). I'm out of ideas and open to suggestions.
Looks like someone changes OpenLDAP DB during your session. Don't you have any processes with access to MDB file except this instance of OpenLDAP?
It may be slapadd/slapmodify/2nd slapd instance with the same directory value in config.
If not, could you show your slapd.conf (don't forget to change rootpw)

Application log not writing logs in JBOSS 7.2 AS server

I have deployed my application on JBOSS7.2. It is working fine on some servers. But on some servers, application log is not working. It just creates the file and writes "successfully created memcache client
" and nothing else is logged. The same build in working fine on some JBOSS 7 servers. Tried whatever is written on internet, not helping.
could be a problem with your:
logging-configuration
the general logging level
Which log level are you using in your application?
Regards,
Sascha

ClientSession is closed by HornetQ

we encountered the following exception in HornetQ (with HornetQ 2.2.5 GA with JBoss 4.3.3, with the InVM connector. both the client and the server are on the same machine):
hornetq-failure-check-thread,Connection failure has been detected: Did not receive data from invm:0.
the error code is 3 (which is HornetQException.CONNECTION_TIMEDOUT).
this causes the RemotingServiceImpl.FailureCheckAndFlushThread to run, which writes the following log multiple times:
Client connection failed, clearing up resources for session 95406085-7b3a-11e2-86d3-005056b14e26
note that in our application we reuse our ClientSessions. we have one instance of ClientSession per connection (we open multiple connections, one per each client), and the above problem caused one of the sessions to be closed.
after reading this post: Connection timeout issues - Connection failure has been detected
I understood that we need to configure the following on our ServerLocator instance (which is used to create the ClientSessionFactory that creates our ClientSessions):
ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(connectorConfig);
locator.setClientFailureCheckPeriod(Long.MAX_VALUE);
locator.setConnectionTTL(-1);
this configurtion solved the problem, and the above error was not reproduced.
our problem is the following - in case the sessions will be closed again by HornetQ from some other reason, how can we create new sessions instead of the closed ones?
I'm asking this because after we found the session was closed (and before we set the clientFailure and clientTTL values), we tried to create a new session by calling the createSession(false, true, true) method on the ClientSessionFactory instance (we create that instance upon system startup only once and resue it since) and it failed with the following error:
HornetQException[errorCode=0 message=Failed to create session]
so we didn't succed to create new sessions, and the only solution was restarting the JBoss.
note that we can't restart our application on the client site, so we need to find a way to create new sessions in case the old ones were closed from some reason.
Instead of doing that, you should probably configure retry and use a proper value, that way your connection will be reconnected.
But since you're using inVM, and as long as you don't stop the server you should be fine with that configuration. However if you intend to restart just the server, you could use reconnectionRetry (-1) and the session would be reattached or recreated seamesly to you.
anyway I would recommend you going to a newer version beyond 2.2.5.