3 Replies Latest reply on Jul 6, 2004 5:38 AM by darranl

    File download via OutputStream causing jboss server to crash

    sian_baldwin

      I have an application which allows users to upload and download files from a remote fileserver. I use enterprise ftp (open source code) to ftp the file from the fileserver to a byte array and then open up an OutputSream and pass in the byt array.

      The problem is that for large files of about 5mb, the jboss server frequently restarts whilst the OutputStream is writting. This of course means that the file is corrupted when the user goes to try and open it.

      Any ideas as to why this might happen?

        • 1. Re: File download via OutputStream causing jboss server to c
          darranl

          Can you describe what you mean by 'the jboss server frequently restarts'.

          Also are you getting any errors or stack traces in the logs?

          Which JBoss version and which servlet container are you using?

          • 2. Re: File download via OutputStream causing jboss server to c
            sian_baldwin

            Hi,

            JBOSS 2.3.2 (integrated tomcat). By server restarts I mean, as if you ran the shutdown.sh script and the start.sh script. I am tailing the logs on putty and when I try and download a large file I can see that after a while the server shutsdown and then restarts. I am guessing that there is some kind of auto-restart mechanism on the box that kicks in if the server crashes...and that downloading large files crashes the box?

            The log seems to truncate when it restarts so I dont have anything to send. This is driving me mad! It works fine on localhost and seemed to work for months on my last hosting provider - however I moved from there as the box seemed to frequently crash. I am now wondering if it was the code and there was just no mechanism to restart the server on the old box - and really this is just the same problem?

            I simply ftp a file from a fileserver into a bytearray. Then pass the bytearray into the ServletOuputStream. I am of course setting all the headers so explorer recognises it as a download. Like i say it works but it seems to crash the box?

            • 3. Re: File download via OutputStream causing jboss server to c
              darranl

              Are you able to edit the log4j.xml configuration file?

              If you can there is a parameter in the file appender that by default sets Append to false, I think this is the reason a new file is started each time your server is started.

              It does sound as if there is something has been setup to restart JBoss each time it dies, I have only ever seen JBoss die if the JVM has a bug.