5 Replies Latest reply on Jun 6, 2007 10:37 AM by Brian Stansberry

    Clustered EJB3 Client Proxy

    Reinhard Brandstaedter Newbie

      I'm deploying a @clustered annotated ejb3 application on my cluster but when I turn off the jboss node that the client is currently connected to the application is not switching to the other node. It still tries to connect to the (dead) node on port 3873 again and again.

      From the documentation I understand that there is not much more than the annotation needed for the EJB. The client app should try to connect to the client proxy and seamlessly fail over.

      Since this isn't the case I wonder where and how I could configure/check the client proxy. The docs talk about jboss.xml in the client.jar but I'm missing examples there. Also standardjboss.xml contains lots of client-proxy configurations but how would those be used?

      I'm on JBoss 4.2.0GA

      Thanks,
      Reinhard

        • 1. Re: Clustered EJB3 Client Proxy
          Reinhard Brandstaedter Newbie

          Here is the exception I get on the client when turning off a node in the cluster (namely the one the client uses):

          SEVERE: Exception thrown
          
          org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://xxx.xxx.xxx.151:3873/]
          
           at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:530)
          
           at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
          
           at org.jboss.remoting.Client.invoke(Client.java:1550)
          
           at org.jboss.remoting.Client.invoke(Client.java:530)
          
           at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
          
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
           at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
          
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
           at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
          
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
           at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
          
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
           at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
          
           at $Proxy64.find(Unknown Source)
          
           at at.jku.kusss.guifw.entitymanager.domain.ClientEntityManager.find(ClientEntityManager.java:297)
          
           at at.jku.kusss.guifw.widget.LookupEntityListModel.fillItems(LookupEntityListModel.java:269)
          
           at at.jku.kusss.guifw.widget.LookupEntityListModel.<init>(LookupEntityListModel.java:79)
          
           at at.jku.kusss.guifw.widget.LookupEntityListModel.<init>(LookupEntityListModel.java:91)
          
           at at.jku.kusss.guifw.widget.LookupEntityComboBox2$LookupEntityComboBoxModel.<init>(LookupEntityComboBox2.java:168)
          
           at at.jku.kusss.guifw.widget.LookupEntityComboBox2.<init>(LookupEntityComboBox2.java:53)
          
           at at.jku.kusss.gui.contactmngt.city.CitySearchPanel.initComponents(CitySearchPanel.java:71)
          
           at at.jku.kusss.gui.contactmngt.city.CitySearchPanel.<init>(CitySearchPanel.java:48)
          
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
          
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          
           at java.lang.reflect.Constructor.newInstance(Unknown Source)
          
           at java.lang.Class.newInstance0(Unknown Source)
          
           at java.lang.Class.newInstance(Unknown Source)
          
           at com.eea.fw.client.gui.ClientFactory.getSearchPanel(ClientFactory.java:187)
          
           at com.eea.fw.client.gui.window.SearchInternalFrame.setTypes(SearchInternalFrame.java:63)
          
           at com.eea.fw.client.gui.window.SearchInternalFrame.setObjectType(SearchInternalFrame.java:52)
          
           at com.eea.fw.client.gui.WindowFactory.createBaseSearchWindow(WindowFactory.java:187)
          
           at com.eea.fw.client.gui.WindowFactory.createManageSearchWindow(WindowFactory.java:214)
          
           at at.jku.kusss.gui.contactmngt.ContactModule$1.dlgActionPerformed(ContactModule.java:59)
          
           at at.jku.kusss.gui.menu.MenuTree$MenuTreeSelectionListener.valueChanged(MenuTree.java:302)
          
           at javax.swing.JTree.fireValueChanged(Unknown Source)
          
           at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source)
          
           at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source)
          
           at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source)
          
           at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(Unknown Source)
          
           at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(Unknown Source)
          
           at javax.swing.JTree.setSelectionPath(Unknown Source)
          
           at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(Unknown Source)
          
           at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelectionImpl(Unknown Source)
          
           at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown Source)
          
           at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(Unknown Source)
          
           at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
          
           at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
          
           at java.awt.Component.processMouseEvent(Unknown Source)
          
           at javax.swing.JComponent.processMouseEvent(Unknown Source)
          
           at java.awt.Component.processEvent(Unknown Source)
          
           at java.awt.Container.processEvent(Unknown Source)
          
           at java.awt.Component.dispatchEventImpl(Unknown Source)
          
           at java.awt.Container.dispatchEventImpl(Unknown Source)
          
           at java.awt.Component.dispatchEvent(Unknown Source)
          
           at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
          
           at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
          
           at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
          
           at java.awt.Container.dispatchEventImpl(Unknown Source)
          
           at java.awt.Window.dispatchEventImpl(Unknown Source)
          
           at java.awt.Component.dispatchEvent(Unknown Source)
          
           at java.awt.EventQueue.dispatchEvent(Unknown Source)
          
           at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
          
           at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
          
           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
          
           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
          
           at java.awt.EventDispatchThread.run(Unknown Source)
          


          I see a StatelessRemoteProxy and I guess this should be some ClusteredStatelessRemoteProxy?

          • 2. Re: Clustered EJB3 Client Proxy
            Brian Stansberry Master

            Yes, it should be StatelessClusteredProxy. The fact that it's not tells me there is some issue with properly marking the SLSB as @Clustered.

            • 3. Re: Clustered EJB3 Client Proxy
              Brian Stansberry Master

              Also, the standard-jboss.xml stuff is for EJB2, not EJB3.

              • 4. Re: Clustered EJB3 Client Proxy
                Reinhard Brandstaedter Newbie

                 

                Also, the standard-jboss.xml stuff is for EJB2, not EJB3.

                Thought so....thanks

                After searching the source code of this application I found out that the developers didn't annotate all of the EJBs right. Easy to say: "it's their fault" :-)

                Question: is it possible to annotate those EBJs in the jboss.xml?

                • 5. Re: Clustered EJB3 Client Proxy
                  Brian Stansberry Master

                  Yes; just add

                  <clustered>true</clustered>
                  .