@Bean public AnnotatedServiceRegistrationBean annotatedService() { return new AnnotatedServiceRegistrationBean() .setServiceName("annotatedService") .setService(new AnnotatedService()) .setPathPrefix("/annotated") .setDecorators(LoggingService.newDecorator()) .setExceptionHandlers(ImmutableList.of(new IllegalArgumentExceptionHandler())) .setRequestConverters(ImmutableList.of(new StringRequestConverterFunction())) .setResponseConverters(ImmutableList.of(new StringResponseConverter())); }