Maven Plugin for GWT - Access Dev Mode Remotely

429 views
Skip to first unread message

N Troncoso

unread,
Jul 8, 2016, 12:32:26 PM7/8/16
to GWT Users
I need to be able to hit my dev mode machine remotely. I'm using the Maven Plugin for GWT (tbroyer version). The standard commands don't let you hit the remote machine at all.

If I add -Dgwt.bindAddress=0.0.0.0 to the code server command:

call mvn gwt:codeserver -pl client -am -Dgwt.bindAddress=0.0.0.0

I can hit it remotely, but I get a dialog that says "Can't find code server. Please make sure it's ready". I don't know what to do to get past that.
On the same machine, that just means the browser is blocking insecure content. Clicking the shield in the address bar (left in FF, right in Chrome) let's you disable this.
I did this on the remote machine, but it still fails to load.

Any help would be great. For reference, I'm starting tomcat like this:

call mvn tomcat7:run -pl server -am -Denv=dev

Thomas Broyer

unread,
Jul 8, 2016, 1:13:19 PM7/8/16
to GWT Users


On Friday, July 8, 2016 at 6:32:26 PM UTC+2, N Troncoso wrote:
I need to be able to hit my dev mode machine remotely. I'm using the Maven Plugin for GWT (tbroyer version). The standard commands don't let you hit the remote machine at all.

If I add -Dgwt.bindAddress=0.0.0.0 to the code server command:

call mvn gwt:codeserver -pl client -am -Dgwt.bindAddress=0.0.0.0

net.ltgt.gwt.maven:gwt-maven-plugin, which has a gwt:codeserver goal, has no property that binds to gwt.bindAddress "natively", so unless you define a gwt.bindAddress property in your POM and pass -bindAddress explicitly in codeserverArgs, that won't do anything.

org.codehaus.mojo:gwt-maven-plugin has a gwt.bindAddress, but its goal is gwt:run-codeserver.

So, which one do you use, and what's your configuration?
 
I can hit it remotely, but I get a dialog that says "Can't find code server. Please make sure it's ready". I don't know what to do to get past that.
On the same machine, that just means the browser is blocking insecure content. Clicking the shield in the address bar (left in FF, right in Chrome) let's you disable this.
I did this on the remote machine, but it still fails to load.

What are the URLs the browser loads or tries to load?
Also, you may have to pass your machine's IP address or network name instead of 0.0.0.0; and make sure you reach your web server with that same value (I can't remember if it's really needed, but just in case…)

N Troncoso

unread,
Jul 8, 2016, 2:41:13 PM7/8/16
to GWT Users
I'm using the net.ltgt.gwt.maven.gwt-maven-plugin. I didn't know the bindAddress was strickly for the mojo plugin. From what I can tell it's a fairly common parameter for opening something to a network.

I'm not sure what config you're asking about, but this is how the plugin is setup in the pom file:

            <plugin>
                <groupId>net.ltgt.gwt.maven</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <configuration>
                    <moduleName>path.to.Home</moduleName>
                    <moduleShortName>Home</moduleShortName>
                </configuration>
            </plugin>

When working locally, I use https://localhost:8443 to hit dev mode and that works fine. From remote, I'm using https://<server-ip>:8443. Here's the message I'm getting:


Like I said before. This is normal on the local machine. I just disable the security from the browser and it works. But it does not in this case.

I think that answered all your questions.

Thomas Broyer

unread,
Jul 9, 2016, 5:31:19 AM7/9/16
to GWT Users


On Friday, July 8, 2016 at 8:41:13 PM UTC+2, N Troncoso wrote:
I'm using the net.ltgt.gwt.maven.gwt-maven-plugin. I didn't know the bindAddress was strickly for the mojo plugin. From what I can tell it's a fairly common parameter for opening something to a network.

What you ultimately want is passing -bindAddress to GWT's CodeServer; and there's no "automatic" way with the net.ltgt.gwt.maven:gwt-maven-plugin, it has to be explicit.
 
I'm not sure what config you're asking about, but this is how the plugin is setup in the pom file:

            <plugin>
                <groupId>net.ltgt.gwt.maven</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <configuration>
                    <moduleName>path.to.Home</moduleName>
                    <moduleShortName>Home</moduleShortName>

Add
<codeserverArgs>
  <arg>-bindAddress</arg><arg>0.0.0.0</arg>
</codeserverArgs>
(replace 0.0.0.0 with a Maven property –defined in your POM's <properties>, and overridable using -D on the command-line– if you want)

That said, SuperDevMode does not support HTTPS currently: https://github.com/gwtproject/gwt/issues/7535
Bypassing browser security might work partially, but nothing's guaranteed.
Reply all
Reply to author
Forward
0 new messages