Piotr Sobczyk
Piotr Sobczyk

Reputation: 6583

Server-side RequestFactory related error with no stack trace or any other details

Can someone tell me how can I squeeze some more information from GWT application if all error reports that I see in logs are:

Client side: Caused by: java.lang.RuntimeException: Server Error 500...

Server side: [ERROR] 500 - POST /gwtRequest (127.0.0.1) 1420 bytes (red font)

(I run app in dev mode from Maven by gwt:run so it's running on Jetty)

Except that it's related with RequestFactory (/gwtRequest), I have absolutely no idea what's going on. It's possibly related with invalid Entity-Proxy or Request-Service contract, but I have correctly configured RequestFactory-apt validator in both Eclipse and Maven and I'm getting no errors from it (and usually this validation works fine for me).

Any ideas what can I do to learn a little more about a problem and why the heck GWT don't just give me a server stack trace showing what's going wrong on server-side?

EDIT: I found error: I had @Enumerated(EnumType.STRING) enum field in my JPA entity. In database there was varchar value that didn't matched any value of enum. But I still the question is why I didn't get stack trace. If I got it, I'd solved it in 1 min, not in half day.

Upvotes: 0

Views: 567

Answers (1)

Sam
Sam

Reputation: 2747

Same like here: RequestFactory: error.getExceptionType() returns null in Receiver#onFailure

You have to provide your own ExceptionHandler by extending RequestFactoryServlet

Implement this and you get your StackTrace and find the Problem: http://cleancodematters.com/2011/05/29/improved-exceptionhandling-with-gwts-requestfactory/

Takes five minutues and saves you much time now and in future.

Upvotes: 2

Related Questions