jboss 5 ejb invoke issue
emrehe Apr 13, 2011 4:38 AMHello,
Here i met one tricky issue, my test bed is one cluster environemnt based on jboss 5.1.0.as, 2 nodes:
active node: 192.168.100.1
standby node: 192.168.100.2
floating ip address hich we used to access service on jboss 5.1.0.as: 192.168.100.3
i have one ejb service ejb/MyApp deployed on both nodes, its function is insert records in local node database.
my service need to invoke ejb/MyApp to insert records, the successful scenario is: ejb/MyApp on both node should be invoked separately, so the record should be inserted in databse on both nodes, but the issue i met is:
1. step 1: my service invoke ejb/MyApp on active node, it succeed to insert record in active node 192.168.100.1;
2. step 2: my service try to invoke ejb/MyApp on standby node, it finally still invoke the ejb/MyApp on active node, so it try to insert record in active node again, so database insert error is raising.
from the log, i can see the ejb jndi lookup is already finding and cache the ejb info on standby node:
{code}2011-04-13 15:55:09,110 DEBUG [net.sf.ehcache.Cache] (WorkManager(2)-8__EJBHomeLookup 1) ServiceLocator : Is element with key 192.168.100.2ejb/MyApp expired?: true
2011-04-13 15:55:09,110 DEBUG [net.sf.ehcache.Cache] (WorkManager(2)-8__EJBHomeLookup 1) ServiceLocator Memory cache hit, but element expired
2011-04-13 15:55:09,111 INFO (WorkManager(2)-8__EJBHomeLookup 1) (ServiceLocator.java:338) getInitialContext(192.168.100.2)
2011-04-13 15:55:09,111 INFO (WorkManager(2)-8__EJBHomeLookup 1) (ServiceLocator.java:338) getInitialContext(192.168.100.2)
2011-04-13 15:55:09,111 DEBUG (WorkManager(2)-8__EJBHomeLookup 1) (ServiceLocator.java:389) lookup in ctx= javax.naming.InitialContext@218c69
2011-04-13 15:55:09,111 DEBUG (WorkManager(2)-8__EJBHomeLookup 1) (ServiceLocator.java:389) lookup in ctx= javax.naming.InitialContext@218c69
2011-04-13 15:55:09,111 DEBUG [org.jnp.interfaces.TimedSocketFactory] (WorkManager(2)-8__EJBHomeLookup 1) createSocket, hostAddr: /192.168.100.2, port: 1099, localAddr: null, localPort: 0, timeout: 0
2011-04-13 15:55:09,112 FINE [sun.rmi.loader] (WorkManager(2)-8__EJBHomeLookup 1) WorkManager(2)-8__EJBHomeLookup 1: name = "org.jnp.server.NamingServer_Stub", codebase = "http://192.168.100.2:8083/", defaultLoader = org.jboss.util.loading.DelegatingClassLoader@1bc16f5
2011-04-13 15:55:09,113 FINE [sun.rmi.loader] (WorkManager(2)-8__EJBHomeLookup 1) WorkManager(2)-8__EJBHomeLookup 1: name = "java.rmi.server.RemoteStub", codebase = "http://192.168.100.2:8083/", defaultLoader = org.jboss.util.loading.DelegatingClassLoader@1bc16f5
2011-04-13 15:55:09,130 DEBUG (WorkManager(2)-8__EJBHomeLookup 1) (ServiceLocator.java:395) ejb/MyApp of host 192.168.100.2 cached
{code}
could anyone help to identify the root cause? is there something wrong on my cluster, ejb configuration? acutally there is no issue on jboss 4.0.3sp1 platform, after i try to merge service to jboss 5.1.0, this issue happend.
thanks,
Emre