4 Replies Latest reply on Jul 17, 2006 9:44 AM by Nabieh Salim

    JBoss goes down!

    Nabieh Salim Newbie

      Dears,
      We have an application that been used by a 600 users via netowrk connections over the country, at a time, not less than 150 users are online using the application, the main goal of the application is to be an interface for a huge database and oter network components, we are facing a strange behavior of the application server - JBoss, from time to time, it goes down and became unaccessible, and it seems that the application is not able to run any more. I monitored the logs and found lot of exceptions regarding JDBC result sets exceptions says: java.sql.SQLException: Exhausted Resultset, I am sure we are closing every single connection/statement/result set we used! Can any one advice me on this field? We are using DAOs for DB conections, we use JNDI for retrieving datasourses, we cach those common used info into memory, we are using HP servers which considered to be v. good machines. Any comment will be highly appreciated, thanks in advance.
      Note: We have lot of those requests that waits for responses for a period of time, and lot of those requests beeing executed at a time all the day. Those requests goes to queues and wait for the reply as XML from other queues, we are using IBM MQ services.

      Nabieh.

        • 1. Re: JBoss goes down!
          jaikiran pai Master

           

          exceptions says: java.sql.SQLException: Exhausted Resultset


          This has mainly got to do with how you are using the ResultSet. It might be a case that you are invoking the next() method on the ResultSet in a wrong way. Post the code where you are dealing with the ResultSet.

          we are facing a strange behavior of the application server - JBoss, from time to time, it goes down and became unaccessible, and it seems that the application is not able to run any more


          What exactly is happening? Is the JBoss server getting shutdown? Or is it that there is no response from the server?

          Also, which version of JBoss are you using?



          • 2. Re: JBoss goes down!
            Nabieh Salim Newbie

            Dear Jaikiran,
            Your reply is very appreciated, here you are the answers of your questions:

            exceptions says: java.sql.SQLException: Exhausted Resultset


            I have more than 12 exceptions in my DAOs, the whole DAO's works in the same behavior as shown in the following pseudocode:

            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
            con = db.getConnection();
            String sql = "SELECT ....where id = ?";
            ps = con.prepareStatement(sql);
            ps.setInt(1, id);
            rs = ps.executeQuery();
            while (rs.next()) {
             // Get integers, chars, strings, .....
            }
            } catch (SQLException ex) {
             log.error("Exception ...", e);
             throw new DAOException("DAO Exception : ", e);
            }
            
            finally {
             try {
             if (rsGet != null)
             rsGet.close();
             } catch (SQLException e) {
             log.error("Error : ", e);
             }
             if (stmtGet != null) db.close(ps); /* db is a Serializable class where I close my connections and statements and it works very fine */
             db.closeConnection(con);
            }
            


            I suggested to increase the Oracle cursers, does that make scense?


            we are facing a strange behavior of the application server - JBoss, from time to time, it goes down and became unaccessible, and it seems that the application is not able to run any more


            Dear, I have contacted my operation team and ask them about that, they told me that the JBoss is kept running but with no response at all, if you try to enter a web application it gives you the common 'Page not found' html page. I asked them also about the memory, the server has 2 GBs of memory, half of them assigned to the deployed application by setting that condition in the batch file for the java command within JBoss environemt.

            Also, which version of JBoss are you using?


            I contacted the operations, the JBoss version is 'JBoss 4.0.1SP1'

            Your feedback will be very kind of you Jaikiran. Please feel free to ask any question you would like to.


            Nabieh.

            • 3. Re: JBoss goes down!
              jaikiran pai Master

               

              while (rs.next()) {
              // Get integers, chars, strings, .....
              }


              Are you sure that you are not invoking the rs.next() method again *inside* the while loop (Just to make sure that we are not missing anything). Usually the reason for the Exhausted resultset exception is that the user is trying to retrieve the contents of the resultset when it is empty.

              It would be great, if you could post the exception stacktrace so that we could get more hints about the exception.

              they told me that the JBoss is kept running but with no response at all


              This means that the server is running but not responding. Usually in situations like these, it is very helpful to obtain the thread dump to see what exactly is going on the server in the background. The proceedure to obtain the thread dump is explained here:

              http://wiki.jboss.org/wiki/Wiki.jsp?page=StackTrace

              Obtain the thread dump when the server becomes unresponsive. The thread dump will show you what operations are being carried out by each and every thread in JBoss.




              • 4. Re: JBoss goes down!
                Nabieh Salim Newbie

                Dear Jaikiran,
                Thanks for your being concerned about my issue.

                I am quite sure that we do not use rs.next unless in reguler if statements and when one record is to be obtained from it:

                ....
                String sql = "select count(*) as COUNT from table";
                if (rs.next()) {
                 .....
                 int count = rs.get("COUNT");
                }
                

                So, it is okay. And I have been in writing J2EE application about 4 years. It is okay.
                Since we run JBoss as a service and not a DOS console, I have to review this "SendSignal" to achieve the goal of getting those records, I will update you once get a concern. Will be waiting for the JBoss till it gets into that status and get the logs of the threads. Thanks to you, you gave me a great idea.

                Nabieh.