2

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

Dale
  • 21
  • 2

1 Answers1

2

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!

Tom Purl
  • 549
  • 1
  • 3
  • 13