Vaadin 8: REST returns Vaadin's HTML, no response

Please help. I’m getting Vaadin HTML as a response from my client call instead of a string:


Client client = ClientBuilder.newClient();
WebTarget target ="http://localhost:8080/api/rest/hello");
Response response = target.request().get();
String value = response.readEntity(String.class);
System.out.println("Response: " + value);

UI Class:

  @WebServlet(urlPatterns = {"/api/*", "/VAADIN/*"}, asyncSupported = true)
    @VaadinServletConfiguration(closeIdleSessions = true, ui = ApiUI.class, productionMode = false)
    public static class ApiUIServlet extends VaadinServlet { ...

Config Class:

import java.util.HashSet;
import java.util.Set;

@ApplicationPath("/rest") // set the path to REST web services
public class ApplicationConfig extends Application {

        private Set singletons = new HashSet();

        public ApplicationConfig() {
            singletons.add(new HelloWorldService());

    public Set<Class<?>> getClasses() {
        HashSet<Class<?>> classes = new HashSet<>();
        return classes;

    public Set<Object> getSingletons() {
        return singletons;

Service Class:

public class HelloWorldService {

    public String serverMessageText() {
        return "This is a message from the server";


<!doctype html>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=11">
  <style type="text/css">html, body {height:100%;margin:0;}</style>
  <link rel="shortcut icon" type="image/" href="./../../VAADIN/themes/demo/favicon.ico">
  <link rel="icon" type="image/" href="./../../VAADIN/themes/demo/favicon.ico">
  <script type="text/javascript" src="./../../VAADIN/js/app.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="theme-color" content="#00b4f0">
  <link href="VAADIN/manifest.json" rel="manifest">
 <body scroll="auto" class="v-generated-body">
  <div id="ROOT-2521314" class="v-app demo loginui">
   <div class="v-app-loading"></div>
    You have to enable javascript in your browser to use an application built with Vaadin.
  <script type="text/javascript" src="./../../VAADIN/vaadinPush.debug.js?v=8.5.1"></script>
  <script type="text/javascript" src="./../../VAADIN/vaadinBootstrap.js?v=8.5.1"></script>
  <script type="text/javascript">//<![CDATA[
if (!window.vaadin) alert("Failed to load the bootstrap javascript: ./../../VAADIN/vaadinBootstrap.js?v=8.5.1");
if (typeof window.__gwtStatsEvent != 'function') {
vaadin.gwtStatsEvents = [];
window.__gwtStatsEvent = function(event) {vaadin.gwtStatsEvents.push(event); return true;};
    "theme": "demo",
    "versionInfo": {
        "vaadinVersion": "8.5.1",
        "atmosphereVersion": "2.4.24.vaadin1"
    "widgetset": "AppWidgetset",
    "widgetsetReady": true,
    "comErrMsg": {
        "caption": "Communication problem",
        "message": "Take note of any unsaved data, and <u>click here</u> or press ESC to continue.",
        "url": null
    "authErrMsg": {
        "caption": "Authentication problem",
        "message": "Take note of any unsaved data, and <u>click here</u> or press ESC to continue.",
        "url": null
    "sessExpMsg": {
        "caption": "Session Expired",
        "message": "Take note of any unsaved data, and <u>click here</u> or press ESC key to continue.",
        "url": null
    "contextRootUrl": "./../../",
    "vaadinDir": "./../../VAADIN/",
    "frontendUrl": "vaadin://frontend/es5/",
    "debug": true,
    "standalone": true,
    "heartbeatInterval": 300,
    "serviceUrl": "./../.."

What’s the issue? I use jetty:run via Maven.