GWT / SpringBoot startup order

53 views
Skip to first unread message

Craig Mitchell

unread,
Jan 7, 2026, 5:46:11 AM (yesterday) Jan 7
to GWT Users
When I generate a sample "modular-springboot-webapp" project from https://github.com/NaluKit/gwt-maven-springboot-archetype , it doesn't seem to matter what order I start things up (I can start the spring-boot server before the codeserver), and the GWT RPC works fine.

However, with my project, I must start the codeserver first.  If I start the spring-boot server first, I get errors in the log:
io.undertow.servlet: team.drift.server.ServerImpl: ERROR: The serialization policy file '/dt/BDAD2B7008E641096B983533BA494290.gwt.rpc' was not found; did you forget to include it in this deployment?

io.undertow.servlet: team.drift.server.ServerImpl: WARNING: Failed to get the SerializationPolicy 'BDAD2B7008E641096B983533BA494290' for module 'http://lvh.me:8080/dt/'; a legacy, 1.3.3 compatible, serialization policy will be used.  You may experience SerializationExceptions as a result.

Followed by my app crashing when trying to do RPC  with com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException being thrown.

Is is a requirement that the CodeServer must be started first?  Or have I messed something up in one of my pom.xml files?

Vegegoku

unread,
Jan 7, 2026, 6:04:21 AM (yesterday) Jan 7
to GWT Users

I can’t comment on the specifics of Nalu, but the behavior you’re seeing is related to SDM. When running the GWT SDM server, your Spring server relies on the SDM working directory (launcherDir, typically named accordingly) to serve resources. This directory is created when SDM starts.

If the Spring server is started before SDM, the directory will not yet exist, causing the server to fail. Likewise, if launcherDir is configured inside a build directory that gets cleaned between builds (for example, Maven’s target directory), running mvn clean will delete it. In that case, the issue will only appear after a clean build, which you can easily verify.

If you point launcherDir to a location that persists between builds (not generally recommended), the startup order would no longer matter. You can test this by configuring both the Spring server and the SDM launcherDir to use a persistent location and observing the behavior.

Craig Mitchell

unread,
Jan 7, 2026, 6:21:42 AM (yesterday) Jan 7
to GWT Users
Thanks Vegegoku.  On closer inspection of the sample Nalu project, I do get the same errors in the log about the serialization policy file not found, but the RPC still works.  I'm guessing it's because the sample RPC is simple, and the legacy serialization policy still works.

Side question:  Does anyone know if there a way in IntelliJ, to make a compound launcher, so it'll start the CodeServer, wait for a little bit, then start the SpringBoot server?

Vegegoku

unread,
Jan 7, 2026, 6:34:10 AM (yesterday) Jan 7
to GWT Users
Intellij has a compound run configuration but I cant find a delay or ordering option, but I think you still do one run configuration, then add a before task that runs the code server, and start the SDM there, but I dont think you want to do that and wait every time you run your app for SDM to start - even when you dont clean build - and if you just cant live with the current behavior just point to a persisted launch folder that is maybe ignored and clean  - not deleted - on every clean build.

I never tested any of this though.

Craig Mitchell

unread,
Jan 7, 2026, 6:43:54 AM (yesterday) Jan 7
to GWT Users
The "before launch -> run another configuration" task doesn't work because the CodeServer never finishes, so it just endlessly waits for it.

It's possible to do a "before launch -> run external tool" task, but then IntelliJ doesn't know what you're doing, and doesn't know how to stop the CodeServer.

Craig Mitchell

unread,
Jan 7, 2026, 6:54:12 AM (yesterday) Jan 7
to GWT Users
Figured out a solution.

1. Create this class:

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;

public class GwtCodeServerWaiter {
  private static final String HOST = "localhost";
  private static final int PORT = 9876;
  private static final int TIMEOUT_MS = 30_000;

  public static void main(String[] args) throws InterruptedException {
    long start = System.currentTimeMillis();

    System.out.println("Waiting for GWT CodeServer...");

    while (true) {
      try (Socket socket = new Socket()) {
        socket.connect(new InetSocketAddress(HOST, PORT), 1000);
        System.out.println("GWT CodeServer is up");
        return;
      }
      catch (IOException ignored) {
        if (System.currentTimeMillis() - start > TIMEOUT_MS) {
          throw new IllegalStateException("GWT CodeServer did not start in time");
        }
        Thread.sleep(1000);
      }
    }
  }
}

2. Create a launcher for it in IntelliJ.
3. Add that launcher as a "Before launch -> Run another application" for the SpringBoot launcher.

Now the SpringBoot server won't start until the CodeServer is running.

Frank Hossfeld

unread,
1:08 AM (17 hours ago) 1:08 AM
to GWT Users
After a 'mvn clean compile' the launcher Dir - as Vegegoku already mentioned - does not exists. Now, starting the codeserver, the luncherdir gets created (usually it is done, as soon as the codeserver url is printed) and now it is possible to start the Spring Boot application. The problem is not realated to Nalu. ;-)

As long as there is no new 'mvn clean' both run configrations can be started at the same time.

Changes to the Nalu stuff don't require always a 'mvn clean compile' In many cases a 'mvn compile' is enough to get the changes online. 

Craig Mitchell

unread,
2:54 AM (15 hours ago) 2:54 AM
to GWT Users
Just to clarify, the Nalu sample always worked, it was my project that was having issues.  All fixed now, with an automated launcher making the GWT CodeServer always start before the Spring Boot server.

> As long as there is no new 'mvn clean' both run configrations can be started at the same time.

I'm not sure I'd be doing this.  If you've made RPC code changes, and start the Spring Boot server first, I think you'll run into issues.  Unless you manually do a compile, but do people actually do manual compiles?  I just start the CodeServer, and it compiles automatically if needed.
Reply all
Reply to author
Forward
0 new messages