Actually, I have run the two servers named node1 and node2 with Apache modjk load balancer by keeping node1 as the main node and it only bound the queue/order and queue/mail.
I have did the below modification in both the server machines node1 as well as node2.
I have copied the jndi.properties file from <JBOSS_HOME>/server/node1/conf/ path and copied to <JBOSS_HOME>/server/node1/lib/ path and with the following modifications.
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=<node1-ipaddress>:1100, <node2-ip address.:1100
And, the lookup of queue is taken place in the application as follows.
In the file,
ic = new InitialContext( ); Queue queue = ( Queue ) ic.lookup( queueName ); QueueConnectionFactory factory = ( QueueConnectionFactory ) ic.lookup( JNDINames.QUEUE_C ONNECTION_FACTORY ); cnn = factory.createQueueConnection( );
While running the application,
all the transaction is done by node1 till clicking the Submit button for sending mail to user. When I hit the submit button, the transaction goes to the second node node2 in which the queue is not bound.
1. While two server is running, the sending of mail is not done and error comes as shown my post above.
2. If any of one node is down, its automatically bound the queue and running the petstore application successfully.
My problem is, the application should run successfully when all the nodes in the cluster are active.
Please help me.