1 2 Previous Next 16 Replies Latest reply on Jan 14, 2008 5:51 AM by Nicolas Medoc

    ConnectionTimeout when accessing ejb3 beans

    Joachim Van der Auwera Expert

      I tried replacing jboss-service.xml in ejb3.deployer/META-INF with

      <?xml version="1.0" encoding="UTF-8"?>
      
      <server>
       <mbean code="org.jboss.ejb3.EJB3Deployer" name="jboss.ejb3:service=EJB3Deployer">
       <depends>jboss.aop:service=AspectDeployer</depends>
       </mbean>
      
       <mbean code="org.jboss.remoting.transport.Connector"
       xmbean-dd="org/jboss/remoting/transport/Connector.xml"
       name="jboss.remoting:type=Connector,transport=socket3873,handler=ejb3">
       <depends>jboss.aop:service=AspectDeployer</depends>
       <attribute name="InvokerLocator">socket://0.0.0.0:3873</attribute>
       <attribute name="Configuration">
       <config>
       <invoker transport="socket">
       <attribute name="socketTimeout">360000</attribute>
       </invoker>
       <handlers>
       <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
       </handlers>
       </config>
       </attribute>
      <!--
       <attribute name="InvokerLocator">socket://0.0.0.0:3873</attribute>
       <attribute name="Configuration">
       <handlers>
       <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
       </handlers>
       </attribute>
      -->
       </mbean>
      
      </server>
      

      to increase the connection timeout (according to the Jboss Remoting docs), but this does not seem to make a difference.

      Is there anything else I can do?

      Thanks for the help,
      Joachim

        • 1. Re: ConnectionTimeout when accessing ejb3 beans
          Tom Elrod Master

          You need to comment out the first:

          <attribute name="InvokerLocator">socket://0.0.0.0:3873</attribute>
          


          The connector will look for first the InvokerLocator attribute and if is not there, then try to use the element from the Configration attribute. So in your case, the transport config is still for socket://0.0.0.0:3873 (with default timeouts).

          • 2. Re: ConnectionTimeout when accessing ejb3 beans
            Tom Elrod Master

            So should be:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <server>
             <mbean code="org.jboss.ejb3.EJB3Deployer" name="jboss.ejb3:service=EJB3Deployer">
             <depends>jboss.aop:service=AspectDeployer</depends>
             </mbean>
            
             <mbean code="org.jboss.remoting.transport.Connector"
             xmbean-dd="org/jboss/remoting/transport/Connector.xml"
             name="jboss.remoting:type=Connector,transport=socket3873,handler=ejb3">
             <depends>jboss.aop:service=AspectDeployer</depends>
             <attribute name="Configuration">
             <config>
             <invoker transport="socket">
             <attribute name="socketTimeout">360000</attribute>
             <attribute name="serverBindAddress">0.0.0.0</attribute>
             <attribute name="serverBindPort">3874</attribute>
             </invoker>
             <handlers>
             <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
             </handlers>
             </config>
             </attribute>
            <!--
             <attribute name="InvokerLocator">socket://0.0.0.0:3873</attribute>
             <attribute name="Configuration">
             <handlers>
             <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
             </handlers>
             </attribute>
            -->
             </mbean>
            
            </server>
            


            Also could have just left the InvokerLocator attribute and put the params there (they are interchangeable, just a little harder to configure if have a lot of params). For example, could have been:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <server>
             <mbean code="org.jboss.ejb3.EJB3Deployer" name="jboss.ejb3:service=EJB3Deployer">
             <depends>jboss.aop:service=AspectDeployer</depends>
             </mbean>
            
             <mbean code="org.jboss.remoting.transport.Connector"
             xmbean-dd="org/jboss/remoting/transport/Connector.xml"
             name="jboss.remoting:type=Connector,transport=socket3873,handler=ejb3">
             <depends>jboss.aop:service=AspectDeployer</depends>
             <attribute name="InvokerLocator">socket://0.0.0.0:3873/?socketTimeout=360000</attribute>
             <attribute name="Configuration">
             <handlers>
             <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
             </handlers>
             </attribute>
             </mbean>
            
            </server>
            


            • 3. MultipleConnectors WAS: ConnectionTimeout when accessing ejb
              Clebert Suconic Master

              We will in a near future, add Connector to the main jboss-service.xml.

              If we do that, do we still need to keep Connector configured at ejb3.deployer/META-INF?

              Is this because you want to run ejb3 in separate?

              If so, what about create a separate Connector configuration, like connector-service.xml, so everybody would use the same locator port to use Remoting, and them if we/the user decide to change any other config we would have a single place of change

              -clebert

              • 4. Re: ConnectionTimeout when accessing ejb3 beans
                Joachim Van der Auwera Expert

                I tried both configuratoin methods mentioned above, but it the client still given a ConnectionTimeout after 60s.

                Is the timeout propagated to the client?

                Joachim

                • 5. Re: ConnectionTimeout when accessing ejb3 beans
                  Joachim Van der Auwera Expert

                  As proof of concept, I also tested by recompiling JBossRemoting with a default timeout of 360000ms, and that did solve the problem.

                  Should I create a jira issue for this?

                  Joachim

                  • 6. Re: ConnectionTimeout when accessing ejb3 beans
                    Tom Elrod Master

                    When you use the configuration that includes:

                    <attribute name="InvokerLocator">socket://0.0.0.0:3873/?socketTimeout=360000</attribute>
                    


                    the param should be passed to the client and set. In the other config, will need to add an isParam attribute, such as:

                    <attribute name="socketTimeout" isParam="true">360000</attribute>
                    


                    as per http://wiki.jboss.org/wiki/Wiki.jsp?page=Remoting_Connector_Configuration.

                    Another way to check that it is getting set on the client is to set your debugging on the client to DEBUG level and check to see the following gets logged:

                    Setting SocketClientInvoker::timeout to:
                    





                    • 7. Re: ConnectionTimeout when accessing ejb3 beans
                      Tom Elrod Master

                      BTW, I added a test case in the remoting project to verify that client socket timeout is working via config. They are checked in under the org.jboss.test.remoting.transport.socket.timeout package.

                      • 8. Re: ConnectionTimeout when accessing ejb3 beans
                        Lucas Uyezu Newbie

                        Hello guys,

                        I've donwloaded version 1.2.1 final of JBoss Remoting, but it did not solved my problem (yet).
                        After downloading it, I copied jboss-remoting.jar to %JBOSS_HOME%\server\all\lib, replacing the old one. But it still gets Timeouts of 60s.
                        What am I missing in order to install Jboss Remoting 1.2.1 into JBoss 4.0.3RC2?

                        Thanks in advance,

                        Lucas Uyezu

                        • 9. Re: ConnectionTimeout when accessing ejb3 beans
                          J-C jc Apprentice

                          Hi,

                          I'm trying to use the solution with in ejb--deployer/META-INF/jboss-service.xml

                          <attribute name="InvokerLocator">socket://0.0.0.0:3873/?socketTimeout=360000</attribute>
                          


                          From a previous post it seems that something has to be add for the client. My client is a standalone applicaion, I have no specific config files for jboss. I do not understand if I have to start the client with timeout properties (and if it is the case what is the property and where should I add it) ?

                          Thanks



                          • 10. Re: ConnectionTimeout when accessing ejb3 beans
                            Joachim Van der Auwera Expert

                            Unfortunately, it still does not work. With the "isParam" I see in the jboss logs that the parameter is appended to the invoker name, but it still doesn't work.

                            As a test, I changed the port in the ejb3.deployer/META-INF/jboss-service.xml file. When jboss starts it logs the correct address, however on the client side it still tried to connect to port 3873. So it seems the parameters are not passed to the client after all.

                            Are there any other special tricks which need to be considered?

                            Thanks for the help,
                            Joachim

                            • 11. Re: ConnectionTimeout when accessing ejb3 beans
                              Steve Rose Newbie

                              I am having the same problem. Let me know if you guys find a solution.

                              • 13. Re: ConnectionTimeout when accessing ejb3 beans
                                Lucas Uyezu Newbie

                                Hello guys,

                                I have a doubt about how the server acts when there's a socketTimeout.
                                In my tests, i put the following code on the ejb3 method:

                                Thread.sleep(60000);
                                


                                and this is making the client throw exceptions. But the problem is in the fact that the server keeps running the method until its end.

                                Is there any way to stop/abort/terminate the method, when the client lose its connection with it?

                                Lucas Uyezu

                                • 14. Re: ConnectionTimeout when accessing ejb3 beans
                                  Jose Vargas Newbie

                                  All,

                                  The following configuration works:

                                  <?xml version="1.0" encoding="UTF-8"?>


                                  jboss.aop:service=AspectDeployer

                                  <mbean code="org.jboss.remoting.transport.Connector" xmbean-dd="org/jboss/remoting/transport/Connector.xml" name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
                                  jboss.aop:service=AspectDeployer
                                  socket://0.0.0.0:3873/?socketTimeout=360000


                                  org.jboss.aspects.remoting.AOPRemotingInvocationHandler




                                  1 2 Previous Next