Unable to Access GWT CodeServer Outside of WSL Environment

51 views
Skip to first unread message

Anders Kobberup

unread,
May 8, 2024, 11:36:30 AMMay 8
to GWT Users
I am encountering an issue with accessing the GWT CodeServer from outside the Windows Subsystem for Linux (WSL) environment. I'm hoping to get some guidance or assistance on resolving this issue.

The problem arises when attempting to access the GWT CodeServer running within the WSL environment from a browser outside of WSL.
Specifically, I can access the GWT application's main page from my browser by navigating to localhost:8001, but I cannot connect to the CodeServer at http://localhost:8501.

From within the WSL terminal i can telnet the port and it looks good, but i cannot from the outside host.

My theory is that the codeserver only accepts connections from localhost - but i do not know how to set a host="0.0.0.0" or something like that on the jetty running the codeserver.

We use the org.codehaus.mojo gwt-maven-plugin with these settings:
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>2.10.0</version>
    <configuration>
        <localWorkers>1</localWorkers>
        <skip>true</skip>
        <draftCompile>true</draftCompile>
        <noServer>true</noServer>
        <compileReport>false</compileReport>
        <logLevel>INFO</logLevel>
        <style>OBF</style>
        <sourceLevel>auto</sourceLevel>
        <extraJvmArgs>-Xmx7G --add-opens java.base/java.lang=ALL-UNNAMED</extraJvmArgs>
        <workDir/>
        <module>com.toh.manager.ManagerclientDev</module>
        <strict>true</strict>
        <port>8001</port>
        <debugPort>8010</debugPort>
        <codeServerPort>8501</codeServerPort>
        <runTarget>managerclient.html</runTarget>
        <hostedWebapp>${project.basedir}/src/main/webapp</hostedWebapp>
        <persistentunitcache>true</persistentunitcache>
        <persistentunitcachedir>/tmp/gwt-${project.build.finalName}</persistentunitcachedir>
    </configuration>
</plugin>

Please let me know if you need anymore information

Craig Mitchell

unread,
May 9, 2024, 12:02:22 AMMay 9
to GWT Users
I haven't used that old plugin for awhile, but I think you need to set the  bindAddress to 0.0.0.0:  https://gwt-maven-plugin.github.io/gwt-maven-plugin/eclipse-mojo.html#bindAddress

You might like to do a test with generating a sample app with https://github.com/tbroyer/gwt-maven-archetypes which will use https://github.com/tbroyer/gwt-maven-plugin instead, and see if that works.  More instructions here:  https://www.gwtproject.org/gettingstarted-v2.html

Anders Kobberup

unread,
May 9, 2024, 3:15:13 AMMay 9
to GWT Users
Hi Craig

That works - awesome!
We have been using GWT since 2010 for our monolith of a project and have never found the need to change the maven plugin. Whats the improvements over the old plugin?

Kind regards - and thanks again!

/Anders

Anders Kobberup

unread,
May 9, 2024, 4:10:14 AMMay 9
to GWT Users
I found that info after sending the reply. Thanks for your help!
Reply all
Reply to author
Forward
0 new messages