About Java and JRuby Development
JEE, Spring, Guice
Hibernate, Java Persistence (JPA)
and various Web Frameworks

Hot topics

eBook shop

PDF edition of articles

Window id concept

An approach to leverage the use of the HTTP session

Web Framework Test and Analysis

Article series on web technologies with detailed reviews.

Hibernate eBook

A continuously updated book on Hibernate and Java Persistence

GWT tip - better exception logging on the server

The GWT servlet is not very helpful considering exceptions of the server code. A nested exception gets hidden from the user. This can easily be improved by overriding the process method in a GWT servlet.

public class FooServiceImpl extends RemoteServiceServlet implements FooService {

    final Logger logger = LoggerFactory.getLogger(StockServiceImpl.class);

// ...
 @Override
 public String processCall(String payload) throws SerializationException {
   try {
    return super.processCall(payload);
   } catch (RuntimeException e) {
    logger.warn("Service Layer threw exception: ", e);
    // normally bad style but we need to throw again to inform the client
    throw e;
   }
 }
}

Best Regards

Sebastian Hennebrueder