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.
On Wednesday, 7 January 2026 at 10:43:54 pm UTC+11 Craig Mitchell wrote:
> 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.
>
> On Wednesday, 7 January 2026 at 10:34:10 pm UTC+11 Vegegoku wrote:
>
>> 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.
>>
>> On Wednesday, January 7, 2026 at 2:21:42 PM UTC+3 Craig Mitchell wrote:
>>
>>> 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?
>>>
>>> On Wednesday, 7 January 2026 at 10:04:21 pm UTC+11 Vegegoku wrote:
>>>
>>>> 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.
>>>> On Wednesday, January 7, 2026 at 1:46:11 PM UTC+3 Craig Mitchell wrote:
>>>>
>>>>> 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?
>>>>>
>>>>
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/google-web-toolkit/59423ec0-805a-4bb1-b170-18de3f070510n%40googlegroups.com.