5 Replies Latest reply on Jun 29, 2004 5:01 PM by theimmortal

    File-pm and Zero length files

    theimmortal Newbie

      We are using Jboss-3.2.3 and the file-pm-service.xml for JMS. During the course of execution, for whatever reason a Zero-length messages is in one of the Queue directories. This is not a problem until we restart JBoss. Upon restarting JBoss the pm fails to load properly due to an error in the log indicating it cannot reconstruct the Queue that contains the Zero-length message.

      I have used search, read the JMS Wiki and cannot find anything relevant to this problem (maybe I used the wrong search terms.. but I did try). So the question is how can we configure the file-pm to ignore these Zero-length files and continue (if that is possible) ?

      Currently we have to restop JBoss, manually delete the Zero-length files then restart. Is there an alternative other than not making the Zero-length files to begin with (which we are not really sure why that is happening). ?

        • 1. Re: File-pm and Zero length files
          Elias Ross Master


          The File PM is not being actively maintained. You can still help contribute fixes to the JBoss team, however. Please take a look at the source code.

          What is your operating system and Java version?

          • 2. Re: File-pm and Zero length files
            theimmortal Newbie

            Solaris 8 and JDK 1.4.2.

            • 3. Re: File-pm and Zero length files
              Elias Ross Master


              Could you post the stack trace?

              If it's in this file:
              src/main/org/jboss/mq/pm/file/MessageLog.java

              Add a try { } catch { } clause in
              protected void restoreMessageFromFile(TreeMap store, File file )

              Have it catch the appropriate exception (IOException) and log an error rather than let it propagate.

              • 4. Re: File-pm and Zero length files
                aparfeno Newbie

                Hi,
                I've discovered a bug in file PM that may be the cause of the problem here. If you use queue name that has characters which are not legal for FS (for example: myqueue@home), PM will encode it the illegal characters
                and create directory to store queue messages with that name (so instead of data/jbossmq/db/myqueue@home, it is data/jboss/db/myqueue%064home). When jboss starts up, PM fails to decode the name and therefore does not find that queue on the FS and thus assums that the queue did not exist.
                So the simple workaround is to avoid FS-illegal chars in your queue/topic names!

                Alex

                • 5. Re: File-pm and Zero length files
                  theimmortal Newbie

                  We found that the problem had to do with our applications and JBoss shutdown. If JBoss is being shutdown while the applications are still running (sending messages, etc), then the messages are not flushed to disk properly; thus creating 0 length files.

                  Our fix was to change the machine's reboot sequence to shutdown our applications first, then shutdown JBoss. This does not solve the problem if JBoss goes down or someone *accidentally* (hahaha) shuts JBoss down.