Alex Rivera | Logout

Problems with jetty crashing intermittently

Asked 2010-08-18T07:00:42.190
9

I'm having problems with jetty crashing intermittently, I'm using Jetty 6.1.24.

I'm running a neo4j Spring MVC webapp, Jetty will stay running for approx 1 hour and then I have to restart Jetty. It is running on small amazon ec2 instance, debian with 1.7gb of RAM.

I start Jetty using java -Xmx900m -server -jar start.jar

I am connecting to the server using putty, when Jetty crashes the putty session disconnects, I cannot see what error caused it to crash.

I would like to be able to see if it is an error generated by Spring, I'm not sure how to log the output from the spring app with Jetty. Or if it is Jetty or a memory issue, what would be the best way to monitor Jetty? I cannot recreate this on my local machine running windows. What do you think would be the best way to approach this? Thanks

Edit
Report

1 Answer

5

This isn't really a programmer question; perhaps it'll be moved over to ServerFault.

You didn't specifically state which operating system you're using, but I'm hazarding a guess at some Linux distribution. You have two options of figuring out what's wrong:

  1. Start your session in screen. Screen will live for as long as the actual machine is powered on, until you reboot the operating system (or you exit screen).

    you start screen like this

    screen
    

    and you get a new prompt where you can start your program (cd foo, jetty, etc). When you're happy and you just need to go somewhere, you can disconnect the screen by hitting CTRL+A and then CTRL+D. you'll drop back to the place you were before you invoked screen.

    To get back to seeing the screen you type screen -R which means to resume an existing screen. you should see jetty again.

    The nice thing is that if you lose connection (or you close putty by accident or whatever) then you can use screen -list to get a list of running screens, and then forcibly detach them -D and reattach them to the current putty -R, no harm done!

  2. Use nohup. Nohup more or less detaches the process you're running from the console, so none of its output comes to the terminal. You start your program in the normal fashion, but you add the word nohup to your command.

    For example:

    nohup ls -l &
    

    After ls -l is complete, your output is stored in nohup.out.

answered 2010-08-21T18:16:09.350

Your Answer