9 Replies Latest reply on Jun 2, 2004 8:29 AM by rafcio

    JBoss 3.2.2 abnormal termination

    rafcio

      Hi,

      we have sometimes abnormal JBoss 3.2.2 termination. It happens only on production. We can't reproduce it on out test instance. We have two JBoss instances (but not in cluster). JBoss crashes without any error message, while we make SQL queries directly, i.e.:

      public int getCountOfMediaForMandant(Integer mandant_id) {
      if (logger.isDebugEnabled()) {
      logger.debug("getCountOfMediaForMandant('" + mandant_id + "') entered");
      }

      Connection con = null;
      PreparedStatement pstmt = null;
      ResultSet rs = null;

      try {
      con = getConnection();

      if (con != null) {
      String query = "select count(m.media_id) from media m, users u where u.mandant_id = ? and m.user_id = u.user_id";

      pstmt = con.prepareStatement(query);
      pstmt.setInt(1, mandant_id.intValue());
      rs = pstmt.executeQuery();

      if (rs.next()) {
      return rs.getInt(1);
      }
      }

      return -1;
      }
      catch (SQLException sqle) {
      logger.fatal("getCountOfMediaForMandant() failed", sqle);
      return -1;
      }
      finally {
      SQLUtils.getInstance().closeConnections(con, pstmt, rs);
      }
      }


      getConnection() implementation:

      public Connection getConnection() {
      logger.debug("getConnection() entered");

      try {
      DataSource datasource = ServiceLocator.getInstance().getDataSource(JNDINamesDataSource.DEFAULT_DS);

      if (datasource != null) {
      return datasource.getConnection();
      }
      }
      catch (ServiceLocatorException sle) {
      logger.fatal("getConnection() failed", sle);
      }
      catch (SQLException sqle) {
      logger.fatal("getConnection() failed", sqle);
      }

      logger.error("getConnection() can't get connection");
      return null;
      }


      closeConnections() implementation:

      public void closeConnections(Connection conn, Statement stmt, ResultSet rs) {
      logger.debug("closeConnections() entered");

      try {
      if (rs != null) {
      rs.close();
      }
      }
      catch (SQLException sqle) {
      logger.fatal("closeConnections() close rs failed", sqle);
      }

      try {
      if (stmt != null) {
      stmt.close();
      }
      }
      catch (SQLException sqle) {
      logger.fatal("closeConnections() close stmt failed", sqle);
      }

      try {
      if (conn != null) {
      conn.close();
      }
      }
      catch (SQLException sqle) {
      logger.fatal("closeConnections() close conn failed", sqle);
      }
      }

      We are working with MySQL 4.0.18 and the MySQL-Connector 3.0.11 on Linux with J2SDK 1.4.2_04.


      Regards,
      Rafal

        • 1. Re: JBoss 3.2.2 abnormal termination

          JVM bug

          Check for dumps in $JBOSS_HOME/bin

          • 2. Re: JBoss 3.2.2 abnormal termination
            rafcio

             

            "adrian@jboss.org" wrote:
            JVM bug

            Check for dumps in $JBOSS_HOME/bin


            There aren't any dump files.


            Regards,
            Rafal

            • 3. Re: JBoss 3.2.2 abnormal termination

              Then check your OS logs.

              JBoss won't just shutdown magically unless it has been told to do so by a signal
              from the OS. Either a bad one (like a segmentation fault) or a ctrl-c from the user.

              The other alternative is you have some code doing System.exit() or System.halt();

              • 4. Re: JBoss 3.2.2 abnormal termination
                rafcio

                 

                "adrian@jboss.org" wrote:
                Then check your OS logs.

                JBoss won't just shutdown magically unless it has been told to do so by a signal
                from the OS. Either a bad one (like a segmentation fault) or a ctrl-c from the user.

                The other alternative is you have some code doing System.exit() or System.halt();


                If JBoss was terminated with specific error, that could help us. But we don't use any System.exit() or System.halt(). As I wrote, we use CMP with row-locking on much our entity beans. Some specific queries, which will be expensive using entity beans, we implemented directly by using JDBC. The connection to our MySQL we get like shows in my firt post from JBoss connection pool. Sometimes (not each time) JBoss crashes only on our production while we use this queries. We can't reproduce this on our test instance. But without any error message. Our JBoss is running as background process. We use row-locking cause we have two instances running not in cluster.


                Regards,
                Rafal

                • 5. Re: JBoss 3.2.2 abnormal termination

                  CMP is irrevelent.

                  JBoss never crashes, the JVM does. If it does not core dump when it receives
                  an errant signal I suggest (at the risk of repeating myself) you look at your OS config.

                  • 6. Re: JBoss 3.2.2 abnormal termination
                    rafcio

                     

                    "adrian@jboss.org" wrote:
                    CMP is irrevelent.

                    JBoss never crashes, the JVM does. If it does not core dump when it receives
                    an errant signal I suggest (at the risk of repeating myself) you look at your OS config.


                    I didn't find any JVM dump or core dump. Which OS configs you mean?


                    Regards,
                    Rafal

                    • 7. Re: JBoss 3.2.2 abnormal termination

                      To show shell config
                      ulimit -a

                      But the JVM should be trapping all signals and producing its own dump. in $PWD

                      If you are sure you are not exiting gracefully (I haven't seen any evidence from you
                      either way - e.g. "tail log/server.log") it is a JVM bug or OS problem.

                      I do not intend to turn this forum into a Sun JVM or Linux support forum.

                      • 8. Re: JBoss 3.2.2 abnormal termination
                        rafcio

                         

                        "adrian@jboss.org" wrote:
                        To show shell config
                        ulimit -a

                        But the JVM should be trapping all signals and producing its own dump. in $PWD

                        If you are sure you are not exiting gracefully (I haven't seen any evidence from you
                        either way - e.g. "tail log/server.log") it is a JVM bug or OS problem.

                        I do not intend to turn this forum into a Sun JVM or Linux support forum.


                        o.k. we have to check something.

                        • 9. Re: JBoss 3.2.2 abnormal termination
                          rafcio

                           

                          "adrian@jboss.org" wrote:
                          To show shell config
                          ulimit -a

                          But the JVM should be trapping all signals and producing its own dump. in $PWD

                          If you are sure you are not exiting gracefully (I haven't seen any evidence from you
                          either way - e.g. "tail log/server.log") it is a JVM bug or OS problem.

                          I do not intend to turn this forum into a Sun JVM or Linux support forum.


                          This is a problemn with JVM with -server option and MySQL driver. I found this:

                          http://lists.mysql.com/java/6511

                          Has anybody the same problems with Java 1.4.2_x?

                          Regards,
                          Rafal