-
1. Re: How to do session replication in clustered JBOSS environment?
rhusar Mar 13, 2013 2:20 PM (in response to udayg1001)How do you test? Most often the problem is with testing. Make sure you are sending the same session ID to both servers.
Did the nodes find each other? By default, the nodes find each other using multicast. Make sure multicast is not blocked by firewall or the switch.
-
2. Re: How to do session replication in clustered JBOSS environment?
udayg1001 Mar 14, 2013 1:07 AM (in response to rhusar)Ya I sending the same session id in both the servers.
first case when I sent the request I create a seesion and next time when i hit with the same session request is going to second node and it is not able to find the session.
Is there any setting done in both nodes to make the session replicable?
-
3. Re: How to do session replication in clustered JBOSS environment?
udayg1001 Mar 14, 2013 1:34 AM (in response to udayg1001)from the jboss doucmentation if read to make session replication in JbossI have done the following in web.xml and jbossweb.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
<context-root>SAO-Platform</context-root>
<replication-config>
<replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
<replication-granularity>SESSION</replication-granularity>
<replication-field-batch-mode>true</replication-field-batch-mode>
</replication-config>
</jboss-web>
in web.xml
<distributable/>
But I am getting error
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[11,9]
Message: Unexpected element '{http://www.jboss.com/xml/ns/javaee}replication-field-batch-mode' encountered
at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:108)
at org.jboss.metadata.parser.jbossweb.ReplicationConfigParser.parse(ReplicationConfigParser.java:86)
at org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser.parse(JBossWebMetaDataParser.java:202)
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:69)
can some body tell what is the right method for seesion replication in JBOSS 7.1 server?.
-
4. Re: How to do session replication in clustered JBOSS environment?
udayg1001 Mar 14, 2013 5:03 AM (in response to udayg1001)Can any please give a solution?
-
5. Re: How to do session replication in clustered JBOSS environment?
rhusar Mar 14, 2013 7:15 AM (in response to udayg1001)What you had before was good, now you are just messing together AS 5 and AS 7 configurations. Revert to what you had.
Can you paste some logs or describe how you are testing?
If you application is <distributable/>, you have SET trigger so you are calling set on your session after every change to the object, you started the HA profile of AS7, you have multicast enabled -- everything should work.
Here is some sample app you can use too https://github.com/clusterbench/clusterbench
-
6. Re: How to do session replication in clustered JBOSS environment?
udayg1001 Mar 14, 2013 12:13 PM (in response to rhusar)I have a sample client application which will retrieve JSON data from the server. Before accessing the data I will be aksked for login page and redirected to the confirm access page. So once I login it creates the session and next time when it ask for confirm access with the session id, request will be hit in the second node, so it is not able to find the session created in first node.
When two nodes are running I not able to retrieve JSON data.
So I shut down one node and request for JSON data in other node in that case I am getting JSON data.
I will check once again with the configuration mentioned and will intimate ASAP.
-
7. Re: How to do session replication in clustered JBOSS environment?
kazaag Mar 14, 2013 3:02 PM (in response to udayg1001)Can you provide the log line containing "Received new cluster view" on each node (the content of this line should provide the list of node in the cluster?
Can you also provide the sout line between 2 lines of --------------------------------------------------- ?
This way we can determine if the cluster has successfully been created.
-
8. Re: How to do session replication in clustered JBOSS environment?
srini.jboss Sep 12, 2014 9:05 AM (in response to udayg1001)Hi Uday Sankar,
I'm also facing the same issue. Please let me know If you solved this problem..
-
9. Re: How to do session replication in clustered JBOSS environment?
vishwadeep.aggarwal1305 Jun 19, 2017 7:04 AM (in response to udayg1001)Hi,
Use the below configuration. I think this will work
1. Create a file named as jboss-web.xml
2. please jboss-web.xml parallel to web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<replication-config>
<replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
<replication-granularity>SESSION</replication-granularity>
</replication-config>
</jboss-web>