6 Replies Latest reply on Jun 28, 2001 9:12 PM by 3004

    the cluster for stateful session bean

    3004
      I set up two cluster servers, weblogic 6.0 sp2 and deploy a sateful session
                bean.
                When the client calls the stateful session bean and is in process, the one
                of the cluster servers goes down.
                Howerver, the client doesn't automatically redirect another cluster server
                and stops running after throwing exception.
                How can the client automatically redirect another cluster server?
                How can the state of stateful session bean failover?
                
                The weblogic-ejb.xml of stateful session bean and the exception are below.
                <?xml version="1.0"?>
                <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0
                EJB//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
                <weblogic-ejb-jar>
                <weblogic-enterprise-bean>
                <ejb-name>test_stateful</ejb-name>
                <stateful-session-descriptor>
                <stateful-session-clustering>
                <home-is-clusterable>True</home-is-clusterable>
                <home-load-algorithm>round-robin</home-load-algorithm>
                <replication-type>InMemory</replication-type>
                </stateful-session-clustering>
                </stateful-session-descriptor>
                <jndi-name>test_stateful</jndi-name>
                </weblogic-enterprise-bean>
                </weblogic-ejb-jar>
                
                The eception is below:
                weblogic.rjvm.PeerGoneException: ; nested exception is:
                weblogic.utils.net.SocketResetException - with nested exception:
                [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                input st
                ream read]
                java.net.SocketException: Connection reset by peer: JVM_recv in socket input
                str
                eam read
                at java.net.SocketInputStream.socketRead(Native Method)
                at java.net.SocketInputStream.read(SocketInputStream.java:86)
                at
                weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                273)
                at
                weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                25)
                at
                weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                23)
                at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                --------------- nested within: ------------------
                weblogic.utils.net.SocketResetException - with nested exception:
                [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                input st
                ream read]
                at
                weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                336)
                at
                weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                25)
                at
                weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                23)
                at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                
                
                
                
                
                
        • 1. Re: the cluster for stateful session bean
          3004
          Weblogic cluster doesn't do failover in case of a PeerGoneException. The
                    reason is
                    in the client side, it can't determine if the call has even reached server
                    (state is changed
                    or not) If it does failover, it will run into the possibility of doing the
                    same state change
                    twice.
                    
                    -Neal
                    
                    
                    "Alex" <alex@gfortunenet.com> wrote in message
                    news:3b283785@newsgroups.bea.com...
                    > I set up two cluster servers, weblogic 6.0 sp2 and deploy a sateful
                    session
                    > bean.
                    > When the client calls the stateful session bean and is in process, the one
                    > of the cluster servers goes down.
                    > Howerver, the client doesn't automatically redirect another cluster server
                    > and stops running after throwing exception.
                    > How can the client automatically redirect another cluster server?
                    > How can the state of stateful session bean failover?
                    >
                    > The weblogic-ejb.xml of stateful session bean and the exception are below.
                    > <?xml version="1.0"?>
                    > <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic
                    6.0.0
                    > EJB//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
                    > <weblogic-ejb-jar>
                    > <weblogic-enterprise-bean>
                    > <ejb-name>test_stateful</ejb-name>
                    > <stateful-session-descriptor>
                    > <stateful-session-clustering>
                    > <home-is-clusterable>True</home-is-clusterable>
                    > <home-load-algorithm>round-robin</home-load-algorithm>
                    > <replication-type>InMemory</replication-type>
                    > </stateful-session-clustering>
                    > </stateful-session-descriptor>
                    > <jndi-name>test_stateful</jndi-name>
                    > </weblogic-enterprise-bean>
                    > </weblogic-ejb-jar>
                    >
                    > The eception is below:
                    > weblogic.rjvm.PeerGoneException: ; nested exception is:
                    > weblogic.utils.net.SocketResetException - with nested exception:
                    > [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                    > input st
                    > ream read]
                    > java.net.SocketException: Connection reset by peer: JVM_recv in socket
                    input
                    > str
                    > eam read
                    > at java.net.SocketInputStream.socketRead(Native Method)
                    > at java.net.SocketInputStream.read(SocketInputStream.java:86)
                    > at
                    > weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                    > 273)
                    > at
                    > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                    > 25)
                    > at
                    > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                    > 23)
                    > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                    > --------------- nested within: ------------------
                    > weblogic.utils.net.SocketResetException - with nested exception:
                    > [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                    > input st
                    > ream read]
                    > at
                    > weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                    > 336)
                    > at
                    > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                    > 25)
                    > at
                    > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                    > 23)
                    > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                    >
                    >
                    >
                    >
                    >
                    
                    
                    
          • 2. Re: the cluster for stateful session bean
            3004
            How should I config the in-memory replication for stateful session bean so
                      that the stateful session bean can failover?
                      
                      "Neal Yin" <nyin@bea.com> ¼¶¼g©ó¶l¥ó news:3b2aa4f5$1@newsgroups.bea.com...
                      > Weblogic cluster doesn't do failover in case of a PeerGoneException. The
                      > reason is
                      > in the client side, it can't determine if the call has even reached server
                      > (state is changed
                      > or not) If it does failover, it will run into the possibility of doing
                      the
                      > same state change
                      > twice.
                      >
                      > -Neal
                      >
                      >
                      > "Alex" <alex@gfortunenet.com> wrote in message
                      > news:3b283785@newsgroups.bea.com...
                      > > I set up two cluster servers, weblogic 6.0 sp2 and deploy a sateful
                      > session
                      > > bean.
                      > > When the client calls the stateful session bean and is in process, the
                      one
                      > > of the cluster servers goes down.
                      > > Howerver, the client doesn't automatically redirect another cluster
                      server
                      > > and stops running after throwing exception.
                      > > How can the client automatically redirect another cluster server?
                      > > How can the state of stateful session bean failover?
                      > >
                      > > The weblogic-ejb.xml of stateful session bean and the exception are
                      below.
                      > > <?xml version="1.0"?>
                      > > <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic
                      > 6.0.0
                      > > EJB//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
                      > > <weblogic-ejb-jar>
                      > > <weblogic-enterprise-bean>
                      > > <ejb-name>test_stateful</ejb-name>
                      > > <stateful-session-descriptor>
                      > > <stateful-session-clustering>
                      > > <home-is-clusterable>True</home-is-clusterable>
                      > > <home-load-algorithm>round-robin</home-load-algorithm>
                      > > <replication-type>InMemory</replication-type>
                      > > </stateful-session-clustering>
                      > > </stateful-session-descriptor>
                      > > <jndi-name>test_stateful</jndi-name>
                      > > </weblogic-enterprise-bean>
                      > > </weblogic-ejb-jar>
                      > >
                      > > The eception is below:
                      > > weblogic.rjvm.PeerGoneException: ; nested exception is:
                      > > weblogic.utils.net.SocketResetException - with nested exception:
                      > > [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                      > > input st
                      > > ream read]
                      > > java.net.SocketException: Connection reset by peer: JVM_recv in socket
                      > input
                      > > str
                      > > eam read
                      > > at java.net.SocketInputStream.socketRead(Native Method)
                      > > at java.net.SocketInputStream.read(SocketInputStream.java:86)
                      > > at
                      > > weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                      > > 273)
                      > > at
                      > > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                      > > 25)
                      > > at
                      > > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                      > > 23)
                      > > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                      > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                      > > --------------- nested within: ------------------
                      > > weblogic.utils.net.SocketResetException - with nested exception:
                      > > [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                      > > input st
                      > > ream read]
                      > > at
                      > > weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                      > > 336)
                      > > at
                      > > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                      > > 25)
                      > > at
                      > > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                      > > 23)
                      > > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                      > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                      > >
                      > >
                      > >
                      > >
                      > >
                      >
                      >
                      
                      
                      
            • 3. Re: the cluster for stateful session bean
              3004
              Consider the following scenario: your stateful session bean is a shopping cart (for
                        example) and it's client executed addItem(...) method and server crashed. The stub has no
                        way of knowing when server crashed - if it happened before method was successfully
                        executed, then retrying is safe, if it happened after method was executed, then retry
                        will add another item to the cart, resulting in 2 items added instead of one, which is
                        probably not what you want.
                        
                        I guess that for this reason only stateless session beans (if their methods are
                        idempotent, meaning that multiple invocations always produce the same result in terms of
                        return values and effects on other components such as database etc) and read-only entity
                        beans support automatic retry.
                        
                        Alex <alex@gfortunenet.com> wrote:
                        > How should I config the in-memory replication for stateful session bean so
                        > that the stateful session bean can failover?
                        
                        > "Neal Yin" <nyin@bea.com> ¼¶¼g©ó¶l¥ó news:3b2aa4f5$1@newsgroups.bea.com...
                        >> Weblogic cluster doesn't do failover in case of a PeerGoneException. The
                        >> reason is
                        >> in the client side, it can't determine if the call has even reached server
                        >> (state is changed
                        >> or not) If it does failover, it will run into the possibility of doing
                        > the
                        >> same state change
                        >> twice.
                        >>
                        >> -Neal
                        >>
                        >>
                        >> "Alex" <alex@gfortunenet.com> wrote in message
                        >> news:3b283785@newsgroups.bea.com...
                        >> > I set up two cluster servers, weblogic 6.0 sp2 and deploy a sateful
                        >> session
                        >> > bean.
                        >> > When the client calls the stateful session bean and is in process, the
                        > one
                        >> > of the cluster servers goes down.
                        >> > Howerver, the client doesn't automatically redirect another cluster
                        > server
                        >> > and stops running after throwing exception.
                        >> > How can the client automatically redirect another cluster server?
                        >> > How can the state of stateful session bean failover?
                        >> >
                        >> > The weblogic-ejb.xml of stateful session bean and the exception are
                        > below.
                        >> > <?xml version="1.0"?>
                        >> > <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic
                        >> 6.0.0
                        >> > EJB//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
                        >> > <weblogic-ejb-jar>
                        >> > <weblogic-enterprise-bean>
                        >> > <ejb-name>test_stateful</ejb-name>
                        >> > <stateful-session-descriptor>
                        >> > <stateful-session-clustering>
                        >> > <home-is-clusterable>True</home-is-clusterable>
                        >> > <home-load-algorithm>round-robin</home-load-algorithm>
                        >> > <replication-type>InMemory</replication-type>
                        >> > </stateful-session-clustering>
                        >> > </stateful-session-descriptor>
                        >> > <jndi-name>test_stateful</jndi-name>
                        >> > </weblogic-enterprise-bean>
                        >> > </weblogic-ejb-jar>
                        >> >
                        >> > The eception is below:
                        >> > weblogic.rjvm.PeerGoneException: ; nested exception is:
                        >> > weblogic.utils.net.SocketResetException - with nested exception:
                        >> > [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                        >> > input st
                        >> > ream read]
                        >> > java.net.SocketException: Connection reset by peer: JVM_recv in socket
                        >> input
                        >> > str
                        >> > eam read
                        >> > at java.net.SocketInputStream.socketRead(Native Method)
                        >> > at java.net.SocketInputStream.read(SocketInputStream.java:86)
                        >> > at
                        >> > weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                        >> > 273)
                        >> > at
                        >> > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                        >> > 25)
                        >> > at
                        >> > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                        >> > 23)
                        >> > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                        >> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                        >> > --------------- nested within: ------------------
                        >> > weblogic.utils.net.SocketResetException - with nested exception:
                        >> > [java.net.SocketException: Connection reset by peer: JVM_recv in socket
                        >> > input st
                        >> > ream read]
                        >> > at
                        >> > weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:
                        >> > 336)
                        >> > at
                        >> > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
                        >> > 25)
                        >> > at
                        >> > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
                        >> > 23)
                        >> > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
                        >> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                        >> >
                        >> >
                        >> >
                        >> >
                        >> >
                        >>
                        >>
                        
                        
                        
                        --
                        Dimitri
                        
              • 4. Re: the cluster for stateful session bean
                3004
                Thank your answer.
                          However, my stateful session bean is used to get the some user information
                          from database while users login.
                          The user information at the stateful session bean can be reused by client .
                          If the fialover happened whether the stateful session bean got the users
                          data from the database or not, the result wouldn't be affected after
                          stateful session bean retries to get information from the datebase.
                          I don't use the session of the jsp or servlet to do this and the client is
                          java class, not jsp and servlet, so the java class directly calls the
                          stateful session bean to get user information.
                          Now the load balance can work, but the failover can't work and the state of
                          statful session bean can't be replication by another cluster server.
                          
                          I don't know why the failover for stateful session bean doesn't work.
                          I also add
                          '<home-is-clusterable>True</home-is-clusterable><home-load-algorithm>round-r
                          obin</home-load-algorithm><replication-type>InMemory</replication-type><repl
                          ication-type>InMemory</replication-type>' in the weblogic-ejb.xml but the
                          failover doesn't happen.
                          Need repication group and pregered secondary group of the cluster set up?
                          
                          Best Regards,
                          Alex
                          
                          "Dimitri Rakitine" <dr@dima.dhs.org> ?????
                          news:3b2b010c@newsgroups.bea.com...
                          > Consider the following scenario: your stateful session bean is a shopping
                          cart (for
                          > example) and it's client executed addItem(...) method and server crashed.
                          The stub has no
                          > way of knowing when server crashed - if it happened before method was
                          successfully
                          > executed, then retrying is safe, if it happened after method was executed,
                          then retry
                          > will add another item to the cart, resulting in 2 items added instead of
                          one, which is
                          > probably not what you want.
                          >
                          > I guess that for this reason only stateless session beans (if their
                          methods are
                          > idempotent, meaning that multiple invocations always produce the same
                          result in terms of
                          > return values and effects on other components such as database etc) and
                          read-only entity
                          > beans support automatic retry.
                          >
                          > Alex <alex@gfortunenet.com> wrote:
                          > > How should I config the in-memory replication for stateful session bean
                          so
                          > > that the stateful session bean can failover?
                          >
                          
                          
                          
                          
                • 5. Re: the cluster for stateful session bean
                  3004
                  Hrm. I'm missing something here - if you use stateful session bean to keep
                            non changing data and not some conversational state then why use stateful
                            component at all and not store this data on the client, or use entity bean?
                            
                            The only purpose of stateful session beans is to keep changing conversational
                            state (at a very high price - stateful components greatly decrease scalability).
                            
                            Alex <alex@gfortunenet.com> wrote:
                            > Thank your answer.
                            > However, my stateful session bean is used to get the some user information
                            > from database while users login.
                            > The user information at the stateful session bean can be reused by client .
                            > If the fialover happened whether the stateful session bean got the users
                            > data from the database or not, the result wouldn't be affected after
                            > stateful session bean retries to get information from the datebase.
                            > I don't use the session of the jsp or servlet to do this and the client is
                            > java class, not jsp and servlet, so the java class directly calls the
                            > stateful session bean to get user information.
                            > Now the load balance can work, but the failover can't work and the state of
                            > statful session bean can't be replication by another cluster server.
                            
                            > I don't know why the failover for stateful session bean doesn't work.
                            > I also add
                            > '<home-is-clusterable>True</home-is-clusterable><home-load-algorithm>round-r
                            > obin</home-load-algorithm><replication-type>InMemory</replication-type><repl
                            > ication-type>InMemory</replication-type>' in the weblogic-ejb.xml but the
                            > failover doesn't happen.
                            > Need repication group and pregered secondary group of the cluster set up?
                            
                            > Best Regards,
                            > Alex
                            
                            > "Dimitri Rakitine" <dr@dima.dhs.org> ?????
                            > news:3b2b010c@newsgroups.bea.com...
                            >> Consider the following scenario: your stateful session bean is a shopping
                            > cart (for
                            >> example) and it's client executed addItem(...) method and server crashed.
                            > The stub has no
                            >> way of knowing when server crashed - if it happened before method was
                            > successfully
                            >> executed, then retrying is safe, if it happened after method was executed,
                            > then retry
                            >> will add another item to the cart, resulting in 2 items added instead of
                            > one, which is
                            >> probably not what you want.
                            >>
                            >> I guess that for this reason only stateless session beans (if their
                            > methods are
                            >> idempotent, meaning that multiple invocations always produce the same
                            > result in terms of
                            >> return values and effects on other components such as database etc) and
                            > read-only entity
                            >> beans support automatic retry.
                            >>
                            >> Alex <alex@gfortunenet.com> wrote:
                            >> > How should I config the in-memory replication for stateful session bean
                            > so
                            >> > that the stateful session bean can failover?
                            >>
                            
                            
                            
                            
                            --
                            Dimitri
                            
                  • 6. Re: the cluster for stateful session bean
                    3004

                              I'm having a similar problem getting stateful session beans to failover.
                              
                              There are some very good reasons for keeping conversational state in a SFSB as
                              opposed to HttpSession on the client - a big one being that conversational objects
                              can be very heavy (more network transmission time) and it also forces the client
                              to resend information back to the server every time (again more network traffic).
                              All of this can be kept in a SFSB on the server.
                              
                              
                              Dimitri Rakitine <dr@dima.dhs.org> wrote:
                              >Hrm. I'm missing something here - if you use stateful session bean to
                              >keep
                              >non changing data and not some conversational state then why use stateful
                              >
                              >component at all and not store this data on the client, or use entity
                              >bean?
                              >
                              >The only purpose of stateful session beans is to keep changing conversational
                              >state (at a very high price - stateful components greatly decrease scalability).
                              >
                              >Alex <alex@gfortunenet.com> wrote:
                              >> Thank your answer.
                              >> However, my stateful session bean is used to get the some user information
                              >> from database while users login.
                              >> The user information at the stateful session bean can be reused by
                              >client .
                              >> If the fialover happened whether the stateful session bean got the
                              >users
                              >> data from the database or not, the result wouldn't be affected after
                              >> stateful session bean retries to get information from the datebase.
                              >> I don't use the session of the jsp or servlet to do this and the client
                              >is
                              >> java class, not jsp and servlet, so the java class directly calls the
                              >> stateful session bean to get user information.
                              >> Now the load balance can work, but the failover can't work and the
                              >state of
                              >> statful session bean can't be replication by another cluster server.
                              >
                              >> I don't know why the failover for stateful session bean doesn't work.
                              >> I also add
                              >> '<home-is-clusterable>True</home-is-clusterable><home-load-algorithm>round-r
                              >> obin</home-load-algorithm><replication-type>InMemory</replication-type><repl
                              >> ication-type>InMemory</replication-type>' in the weblogic-ejb.xml but
                              >the
                              >> failover doesn't happen.
                              >> Need repication group and pregered secondary group of the cluster set
                              >up?
                              >
                              >> Best Regards,
                              >> Alex
                              >
                              >> "Dimitri Rakitine" <dr@dima.dhs.org> ?????
                              >> news:3b2b010c@newsgroups.bea.com...
                              >>> Consider the following scenario: your stateful session bean is a shopping
                              >> cart (for
                              >>> example) and it's client executed addItem(...) method and server crashed.
                              >> The stub has no
                              >>> way of knowing when server crashed - if it happened before method
                              >was
                              >> successfully
                              >>> executed, then retrying is safe, if it happened after method was executed,
                              >> then retry
                              >>> will add another item to the cart, resulting in 2 items added instead
                              >of
                              >> one, which is
                              >>> probably not what you want.
                              >>>
                              >>> I guess that for this reason only stateless session beans (if their
                              >> methods are
                              >>> idempotent, meaning that multiple invocations always produce the same
                              >> result in terms of
                              >>> return values and effects on other components such as database etc)
                              >and
                              >> read-only entity
                              >>> beans support automatic retry.
                              >>>
                              >>> Alex <alex@gfortunenet.com> wrote:
                              >>> > How should I config the in-memory replication for stateful session
                              >bean
                              >> so
                              >>> > that the stateful session bean can failover?
                              >>>
                              >
                              >
                              >
                              >
                              >--
                              >Dimitri