[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
It was indeed the problem. Calling setDistributedState asynchronously from the notification thread does work, and synchronously doesn't. Happily the asynchronicity shouldn't be a problem in my use case. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4206209#4206209 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4206209 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
I wonder if i'm not having the same thread problem as with the HAJNDI lookup with another kind of cluster call. Is it possible to call HAServiceMBeanSupport.setDistributedState from a Notification callback? I seem to have thread race problems. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4205785#4205785 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4205785 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
Hello again. I said i was going to test your asynchronous idea but i'm sorry i can't reproduce the problem again when synchronous.. I must have changed something somewhere. bstansbe...@jboss.com wrote : | You'd have to do something like what people do with JMS temporary queues to turn an asynchronous messaging system into something synchronous;. i.e. execute your commands on a different thread but have that thread at the end send a message to the node that initiated the process telling them it's complete. The node that initiates the process blocks waiting for those messages to come in. | Complex. Yuck. Let's find a better way. | Yeah it could work but i would rather not do that.. anonymous wrote : | The JGroups channel guarantees that the application will receive messages in the order sent. You can't guarantee that if you allow multiple threads to deliver messages. | | JGroups 2.6 (used in AS 5) improves on the single-threaded JG 2.4 architecture by having a thread pool to carry messages up, but it still only allows one thread at a time per sender to be delivering messages to the application. So wouldn't help with your problem. | Ah i see. anonymous wrote : | Yes, because AS 5 uses JBoss Messaging instead of JBossMQ. No more JMS server only running on one node. Instead your topics and queues are deployed on every node. So there would be no need for HA-JNDI to make a group RPC to find the JMS resources; they would be bound locally. | | BTW, you can install JBoss Messaging in 4.2.3 as well. See the JBoss Messaging project pages. Perhaps that's your solution. Hm, i sort of want to try it now. I'm going to read about it a bit before i decide if it's not too tough to migrate. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4205479#4205479 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4205479 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
Ha! Great explanation but that's going to be a big problem for me. Here is what i do: i implement a TopologyChangeListener that uses the HA MBean notification mechanism to send business commands (serializable command pattern objects) to nodes on topology changes. And in my case i need to be sure the commands are executed in order, and that one has been processed before the next is executed. That is, synchronously. I'm going to try your suggestion of executing the command asynchronously on one node to confirm the cause of the problem, but if it really is that, does that mean i can't use the notification mechanism? And it would be the same with mechanisms like HAPartition.callSyncMethodOnCluster() wouldn't it? What do think about my work-around with the Interceptor, could i stay like this or is it too dirty? Also if i understand you right you say that when i go into the @PostConstruct thread i'm not in the same thread that i would be if used an @Interceptor? But i don't get it, in both cases the method seems to be invoked just before the facade method call? The interception is synchronous right? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4205149#4205149 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4205149 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
I forgot one question. You seem to be saying that there is a unique JGroups thread for the node? Is that right and why? I don't see why it should be like the Swing EventDispatchThread thread? Thanks for your help because JMS is the one thing that has caused me the most headaches (so far, touching wood) in my clustering our application. Maybe it is easier in JBoss 5? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4205368#4205368 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4205368 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
chtimi2 wrote : | Here is what i do: i implement a TopologyChangeListener that uses the HA MBean notification mechanism to send business commands (serializable command pattern objects) to nodes on topology changes. | And in my case i need to be sure the commands are executed in order, and that one has been processed before the next is executed. That is, synchronously. | | I'm going to try your suggestion of executing the command asynchronously on one node to confirm the cause of the problem, but if it really is that, does that mean i can't use the notification mechanism? You'd have to do something like what people do with JMS temporary queues to turn an asynchronous messaging system into something synchronous;. i.e. execute your commands on a different thread but have that thread at the end send a message to the node that initiated the process telling them it's complete. The node that initiates the process blocks waiting for those messages to come in. Complex. Yuck. Let's find a better way. anonymous wrote : And it would be the same with mechanisms like HAPartition.callSyncMethodOnCluster() wouldn't it? Yes. anonymous wrote : | What do think about my work-around with the Interceptor, could i stay like this or is it too dirty? | | Also if i understand you right you say that when i go into the @PostConstruct thread i'm not in the same thread that i would be if used an @Interceptor? But i don't get it, in both cases the method seems to be invoked just before the facade method call? The interception is synchronous right? From what I could see from the stack traces, the reason one worked and the other didn't had nothing to do with the @PostConstruct vs. @Interceptor mechanisms. It was purely which thread was invoking on the bean. anonymous wrote : You seem to be saying that there is a unique JGroups thread for the node? Is that right and why? I don't see why it should be like the Swing EventDispatchThread thread? The JGroups channel guarantees that the application will receive messages in the order sent. You can't guarantee that if you allow multiple threads to deliver messages. JGroups 2.6 (used in AS 5) improves on the single-threaded JG 2.4 architecture by having a thread pool to carry messages up, but it still only allows one thread at a time per sender to be delivering messages to the application. So wouldn't help with your problem. anonymous wrote : Thanks for your help because JMS is the one thing that has caused me the most headaches (so far, touching wood) in my clustering our application. Maybe it is easier in JBoss 5? Yes, because AS 5 uses JBoss Messaging instead of JBossMQ. No more JMS server only running on one node. Instead your topics and queues are deployed on every node. So there would be no need for HA-JNDI to make a group RPC to find the JMS resources; they would be bound locally. BTW, you can install JBoss Messaging in 4.2.3 as well. See the JBoss Messaging project pages. Perhaps that's your solution. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4205415#4205415 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4205415 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
Sure, here is the NNFE: | 10:23:13,048 ERROR [STDERR] javax.naming.NameNotFoundException: topic/DepuisEmbarqueTopic | 10:23:13,049 ERROR [STDERR] at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:242) | 10:23:13,049 ERROR [STDERR] at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:155) | 10:23:13,049 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) | 10:23:13,049 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 10:23:13,049 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) | 10:23:13,049 ERROR [STDERR] at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:312) | 10:23:13,049 ERROR [STDERR] at $Proxy238.lookup(Unknown Source) | 10:23:13,049 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667) | 10:23:13,049 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627) | 10:23:13,049 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:392) | 10:23:13,049 ERROR [STDERR] at com.navineo.sa.ejb.session.InwardMessageFacade.initTopics(InwardMessageFacade.java:145) | 10:23:13,049 ERROR [STDERR] at com.navineo.sa.ejb.session.InwardMessageFacade.initRessourcesJMS(InwardMessageFacade.java:110) | 10:23:13,049 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | 10:23:13,049 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | 10:23:13,049 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 10:23:13,050 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:159) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:109) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:623) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:131) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.StrictMaxPool.get(StrictMaxPool.java:141) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54) | 10:23:13,050 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | 10:23:13,050 ERROR [STDERR] at org.jboss.aspects.remoting.ReplicantsManagerInterceptor.invoke(ReplicantsManagerInterceptor.java:51) | 10:23:13,050 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | 10:23:13,050 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110) | 10:23:13,050 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46) | 10:23:13,050 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | 10:23:13,050 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) | 10:23:13,050 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | 10:23:13,051 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304) | 10:23:13,051 ERROR [STDERR] at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:81) | 10:23:13,051 ERROR [STDERR] at org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor.invoke(ClusteredIsLocalInterceptor.java:53) | 10:23:13,051 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | 10:23:13,051 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessClusteredProxy.invoke(StatelessClusteredProxy.java:112) | 10:23:13,051 ERROR [STDERR] at $Proxy462.startManagers(Unknown Source) | 10:23:13,051 ERROR [STDERR] at com.navineo.sa.jmx.ha.taches.ComEmbarquesHAS.doDemarrerTacheEgoiste(ComEmbarquesHAS.java:19) | 10:23:13,051 ERROR [STDERR] at com.navineo.sa.jmx.ha.taches.core.TacheEgoisteHAS.doDemarrer(TacheEgoisteHAS.java:16) | 10:23:13,051 ERROR [STDERR] at
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
OK, I see what's going on here. The key difference between your two stack traces is the thread involved. In the NNFE case, it's the JGroups thread that carries messages up from the network. You then use the thread to instantiate an SLSB, which then does an HA-JNDI lookup, which makes a group RPC to the cluster and then blocks waiting for responses. Problem is the response to that group RPC will not be received because the thread that needs to carry the response up from the network is the same JGroups thread that is blocking waiting for the response! What will happen is the JGroups thread will block 60 secs waiting for a response, never get one, and then return, following which HA-JNDI throws the NNFE. Bottom line -- don't call back into the cluster from a JGroups thread. Somewhere in here you need pass a task to another thread to let it invoke on the SLSB so the JGroups thread can return. | 10:23:13,051 ERROR [STDERR] at $Proxy462.startManagers(Unknown Source) | 10:23:13,051 ERROR [STDERR] at com.navineo.sa.jmx.ha.taches.ComEmbarquesHAS.doDemarrerTacheEgoiste( | ComEmbarquesHAS.java:19) | 10:23:13,051 ERROR [STDERR] at com.navineo.sa.jmx.ha.taches.core.TacheEgoisteHAS.doDemarrer(TacheEg | oisteHAS.java:16) | 10:23:13,051 ERROR [STDERR] at com.navineo.sa.jmx.ha.HAS.demarrer(HAS.java:25) | 10:23:13,051 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | 10:23:13,051 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl | .java:39) | 10:23:13,051 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce | ssorImpl.java:25) | 10:23:13,051 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) | 10:23:13,051 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatc | her.java:155) | 10:23:13,051 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | 10:23:13,051 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) | 10:23:13,051 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker | .java:264) | 10:23:13,051 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | | 10:23:13,051 ERROR [STDERR] at com.navineo.sa.jmx.ha.topologychange.taches.cmd.CommandeRepartitionS | upport.executerLocalement(CommandeRepartitionSupport.java:54) | 10:23:13,052 ERROR [STDERR] at com.navineo.sa.jmx.ha.taches.notification.basculement.BasculeTachesE | goistesHANB$1.handleNotification(BasculeTachesEgoistesHANB.java:90) | 10:23:13,052 ERROR [STDERR] at org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotifica | tion(JBossNotificationBroadcasterSupport.java:127) | 10:23:13,052 ERROR [STDERR] at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotificati | on(JBossNotificationBroadcasterSupport.java:108) | 10:23:13,052 ERROR [STDERR] at org.jboss.ha.jmx.HAServiceMBeanSupport._receiveRemoteNotification(HA | ServiceMBeanSupport.java:476) | The other one works because it's a JBoss Web thread making the call. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4205119#4205119 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4205119 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Very strange problem while looking up HAJMS Topic
Strange. Can you post the stack trace of the NNFE? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4204847#4204847 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4204847 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user