Play server crashes and logging

383 views
Skip to first unread message

Richard

unread,
Nov 24, 2010, 8:53:07 AM11/24/10
to play-framework
Hi,

I'm pretty new to Play and it really seems like a nice framework to
work with however I'm having some major issues.

1. I'm experiencing a lot of what appears to be random server crashes.
For no apparent reason the server shuts down without any kind of error
message. This happens as much as 5-10 times per day (!) and we have to
restart it manually. Does anyone have a clue to why this is happening?
I can't provide much more details since it just stops without reason
or message.

2. I can't figure out how the logging works. When I start the server I
get log output in a nice way in the console. Is there any way I can
get it to produce a log file (e.g. such as server.log in Glassfish) so
that I can record all things going on with the server?

Thanks in advance,

Richard

Ricardo Nascimento

unread,
Nov 24, 2010, 9:44:12 AM11/24/10
to play-framework
Hello,

Use "play start yourapp" command and play will create a log file in
"appdir/logs/system.out"

Guillaume Bort

unread,
Nov 24, 2010, 10:05:41 AM11/24/10
to play-fr...@googlegroups.com
What do you call a server crash?

Does the JVM crash? Does the application stop to respond?

Which version are you using?

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

For anything work-related, use g...@zenexity.fr; for everything else,
write guillau...@gmail.com

Pyppe

unread,
Jan 21, 2011, 5:53:28 AM1/21/11
to play-framework
I just encountered the same issue (at least I think it's the same);
Play Framework just stops (the java-process vanishes) without any
hints (and no log entries either). The issue is reproducible.

What causes this java shutdown is:
List<ExerciseTemplate> exerciseTemplates =
UserDAO.findExerciseTemplates(getLoggedInUser().id);
try {
String exerciseTemplatesAsJson = new
org.codehaus.jackson.map.ObjectMapper().writeValueAsString(exerciseTemplates);
} catch (Exception e) {
Logger.error(e, "We never even get here...");
}

ExericseTemplate is an Entity. Any suggestions on how to find out the
cause? I'm using Play Framework 1.1 on Ubuntu 10.04 with Java(TM) SE
Runtime Environment (build 1.6.0_21-b06).

- Pyppe

On Nov 24 2010, 5:05 pm, Guillaume Bort <guillaume.b...@gmail.com>
wrote:
> Guillaume Bort,http://guillaume.bort.fr
>
> For anything work-related, use g...@zenexity.fr; for everything else,
> write guillaume.b...@gmail.com

Pyppe

unread,
Jan 21, 2011, 6:14:13 AM1/21/11
to play-framework
Update: I cannot be 100% sure, because no stacktrace is shown, but I
believe the Jackson encounters
org.codehaus.jackson.map.JsonMappingException: Infinite recursion
(StackOverflowError).

The same issue of play-server simply dying can be reproduced with a
simple infinite loop within a Controller:

public static void foo() {
int i = 3;
while (true) {
i = i^2;
}
}

IMO, the Play! framework should handle these kind of situation
(regardless of how bad programming :-) without dying.

- Pyppe

Guillaume Bort

unread,
Jan 21, 2011, 6:33:46 AM1/21/11
to play-fr...@googlegroups.com
Well, even with a stackoverflow the Java process shouldn't crash. Or
it's because the process consumes too much memory and linux kill it.
Check the syslogs.

> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

For anything work-related, use g...@zenexity.fr; for everything else,

write guillau...@gmail.com

dao

unread,
Jan 21, 2011, 2:55:20 PM1/21/11
to play-framework
same problem, but only in dev mode when play is run as a window
service.
in the prod mode, no crash.

I suppose it is due to the java XDebug mode?

JDK 1.6, Windows server 2003
Reply all
Reply to author
Forward
0 new messages