Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

A Jetty application is deployed on a server of mine, but keeps on terminating, with little understandable evidence as to why. Any help in resolving this would be greatly appreciated.

Details:

OS:

  Slackware Linux 13.1
  Linux 2.6.32.16 running as Xen guest OS

Java info:

  java version "1.6.0_20"
  Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
  Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

nginx 0.7.67 config (only pertinent items):

    location /app {
      proxy_pass              http://localhost:50013;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        Host $http_host;
    }

The Jetty app is launched via daemontools in a run file containing:

#!/bin/sh
cd /path/to/app
exec setuidgid userXYZ /usr/lib/java/bin/java -server -verbose -jar ./app.jar

There is no evidence in the log as to why it sporadically shuts down (after which daemontools starts it again).

Obviously, when using in-memory sessions, this is not ideal, as users' sessions terminate.

So, I ran the app using strace, without daemontools and the output can be found here:

http://pastebin.com/ZKCMWVQM

Thanks Dale

share|improve this question
add comment

2 Answers

First, is there a file named "core" anywhere on your system? This may have been generated by Jetty when it crashed.

Here's some possibilities:

Your JVM might be thrashing due to frequent garbage collections. You can test this by using a tool like VisualVM. If that GUI is not an option, then you can print GC stats to a log file using JVM switches.

Your JVM might be running out of heap space. GC analysis will also shine some light on this possibility. What happens if you increase the heap size?

My understanding is that you can't really tune Jetty like you can tune a J2EE server, so that's probably fine.

The final possibility that something is wrong with your application. You can use the following tutorial to debug applications running on Jetty: http://sujitpal.sys-con.com/node/508048/mobile.

Good luck!

share|improve this answer
add comment

The "-server" option makes java become a daemon, while daemontools expects application not to exit upon start (main process forks, sets new uid, gid & sid, and exits when daemonizing), that's why daemontools tries to start app over.

Remove "-server" option.

share|improve this answer
    
-1 That's not what it does; the -server option uses the "server" VM rather than the "client" one - have a look at this –  nickgrim Aug 17 '12 at 10:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.