GWT 2.10.0: gradle gwtSuperDev - java.lang.IllegalArgumentException: No selectors

256 views
Skip to first unread message

Michael Conrad

unread,
Aug 9, 2022, 10:20:42 AM8/9/22
to google-we...@googlegroups.com
Meh,

I've managed to break my GWT setup again. This time for superdev mode. Looking for suggestions on where the (I assume) Jetty conflict is coming from.

Getting the following stacktrace after "Module setup completed" is logged when trying to run "./gradlew subproject:gwtSuperDev"

java.lang.IllegalArgumentException: No selectors
        at org.eclipse.jetty.io.SelectorManager.<init>(SelectorManager.java:81)
        at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.<init>(ServerConnector.java:600)
        at org.eclipse.jetty.server.ServerConnector.newSelectorManager(ServerConnector.java:223)
        at org.eclipse.jetty.server.ServerConnector.<init>(ServerConnector.java:216)
        at org.eclipse.jetty.server.ServerConnector.<init>(ServerConnector.java:98)
        at com.google.gwt.dev.codeserver.WebServer.start(WebServer.java:122)
        at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:162)
        at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:104)
        at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:55)


We are using Gradle with the wisepersist GWT plugin:

id "org.wisepersist.gwt" version "1.1.18"
id "org.gretty" version "3.0.8"
gwt {
    gwtVersion = "2.10.0"
    src += files(compileJava.options.annotationProcessorGeneratedSourcesDirectory)

    logLevel = "INFO"
    maxHeapSize = "2048M";
    modules 'com.newsrx.butter.Butter'
    compiler {
        disableClassMetadata = false;
        strict = true;
        style = "OBF";
    }

    // allow sdm on simultaneous modules
//    devModules 'com.newsrx.butter.Butter', 'com.newsrx.newsletter.NewsletterBrowser', 'com.newsrx.dailies.DailiesBrowser'

    superDev {
        noPrecompile = false;
        failOnError = false;
        bindAddress = "0.0.0.0";
    }
}
dependencies.txt

Colin Alworth

unread,
Aug 9, 2022, 2:58:04 PM8/9/22
to GWT Users
Your stack trace lines up except for the top frame - jetty-io 9.4.4.v20210927 has a blank line for SelectorManager.java:81, and the source for the file at that version doesn't contain the string "No selectors". On the other hand, jetty-io 9.2.14.v20151116 has this as a constructor (and line 81 is where it throws):
    protected SelectorManager(Executor executor, Scheduler scheduler, int selectors)
    {
        if (selectors<=0)
            throw new IllegalArgumentException("No selectors");
        this.executor = executor;
        this.scheduler = scheduler;
        _selectors = new ManagedSelector[selectors];
    }

This much older version of jetty-io is the general version of Jetty that GWT 2.9 used (as well as a few earlier GWT versions).

My guess is that you have correctly updated GWT, and the expected version of Jetty has been updated (9.4.44), except somehow you have a dependency on the old version of jetty-io. Check the rest of your classpath, or the particular gradle plugin you are using?

Michael Conrad

unread,
Aug 9, 2022, 2:59:45 PM8/9/22
to google-we...@googlegroups.com, Jason Carter
So, I'm guessing that gretty jetty is leaking into gwt super dev mode somehow.

I added the following as a compile time dependency, and superdev mode seems to be working.

providedCompile "net.sourceforge.htmlunit:htmlunit:2.55.0" // to get superdev mode working

Colin Alworth

unread,
Aug 9, 2022, 3:00:30 PM8/9/22
to GWT Users
My apologies, I didn't notice your attachment until I had already hit send. Checking the list shows that gwt-materialdesign is bringing in an old version of htmlunit (GWT 2.10.0 updated this also), which is in turn bringing in some old jetty versions:
|    |    \--- org.eclipse.jetty.websocket:websocket-client:9.2.18.v20160721
|    |         +--- org.eclipse.jetty:jetty-util:9.2.18.v20160721
|    |         +--- org.eclipse.jetty:jetty-io:9.2.18.v20160721

I can't speak to how your Gradle setup is configured, but I think you should have an explicit compile dependency on gwt-dev:2.10.0, which should at least force jetty-io and htmlunit to be updated to the expected versions.

Michael Conrad

unread,
Aug 10, 2022, 7:50:38 AM8/10/22
to google-we...@googlegroups.com, Jason Carter
I'm now using the following for GWT in our build.gradle files.

I've remove the gwtVersion from the gwt block and switched to using gwtSdk to specify the GWT version.

Really not sure why it keeps getting overridden from dependencies, I would have thought that pulling in gwt-dev would have Gradle pull in the newer version automatically. Is this possibly a bug with the plugin?

I have explicitly specified the htmlunit dependency to get superdev mode to working again.

plugins {
   id "java"
   id "war"
    id "org.docstr.gwt"
    id "org.gretty"
  }

dependencies {
   gwtSdk 'org.gwtproject:gwt-user:2.10.0'
   gwtSdk 'org.gwtproject:gwt-dev:2.10.0'
   providedCompile "net.sourceforge.htmlunit:htmlunit:2.55.0" // to get superdev mode working
}


--
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 google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/779a80e9-9313-4377-b561-4ab5654394bcn%40googlegroups.com.

Michael Conrad

unread,
Aug 10, 2022, 8:01:02 AM8/10/22
to google-we...@googlegroups.com, Jason Carter
Hrm...

This looks like it could be a side effect from the package name change… Different package, no dependency upgrade detected.

-Mike
Reply all
Reply to author
Forward
0 new messages