Startup error: Object of class 'com.google.gwt.dev.shell.jetty.JettyLauncher.WebAppContextWithReload' is not of type 'org.eclipse.jetty.webapp.WebAppContext'.

105 views
Skip to first unread message

mmo

unread,
Jul 20, 2022, 3:30:16 PM7/20/22
to GWT Users
After some substantial fiddling and bug chasing I finally managed to successfully compile our application using GWT 2.10.0. However, when I start this locally using the command line:

mvn -s "D:\Projects\KStA_ZH_RegisterJP\code\application\etc\m2\settings_mms.xml" "gwt:run"   -f "D:\Projects\KStA_ZH_RegisterJP\code\application\zhstregisterjp-web\pom.xml"

(I am using powershell, that's why I need all those quotes)

... then the Jetty-startup ends in:

...
00:00:11.918 [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@aa5455e{/,file:///D:/Projects/KStA_ZH_RegisterJP/code/application/zhstregisterjp-web/target/registerjp/,UNAVAILABLE}{D:\Projects\KStA_ZH_RegisterJP\code\application\zhstregisterjp-web\target\registerjp}
java.lang.IllegalArgumentException: Object of class 'com.google.gwt.dev.shell.jetty.JettyLauncher.WebAppContextWithReload' is not of type 'org.eclipse.jetty.webapp.WebAppContext'.
Object Class and type Class are from different loaders. in file:///D:/Projects/KStA_ZH_RegisterJP/code/application/zhstregisterjp-web/target/registerjp/WEB-INF/jetty-web.xml

What am I missing here or what needs to be changed to get this running again with v2.10? Could some kind soul give me a nudge in the direction to search for?

Thomas Broyer

unread,
Jul 21, 2022, 7:33:53 AM7/21/22
to GWT Users
If you need anything specific, don't use the embedded Jetty.
You have a jetty-web.xml so I assume you need "something specific" → don't use the embedded Jetty.

(it might be that this was plain broken in 2.10 when upgrading the Jetty version, but the last time I had to work on this –that was years ago–, I declared it was the last time and jetty-web.xml wouldn't be supported in the future: if it works, you're lucky, if it doesn't, well, we never said it would so 🤷 ; now other maintainers might have a different opinion and would be willing to investigate)

mmo

unread,
Jul 21, 2022, 11:10:40 AM7/21/22
to GWT Users
OK - thanks for letting me know! I interpret that such that gwt:run and gwt:debug aren't working/supported anymore, right?
Do you test and develop in a Tomcat or what's your preferred setup?

Thomas Broyer

unread,
Jul 22, 2022, 4:41:09 AM7/22/22
to GWT Users
On Thursday, July 21, 2022 at 5:10:40 PM UTC+2 mmo wrote:
OK - thanks for letting me know! I interpret that such that gwt:run and gwt:debug aren't working/supported anymore, right?

Well, first, regarding the plugin you're using: “The legacy maven plugin is still supported but it is strongly encouraged to use the new one for new projects.” https://gwt-maven-plugin.github.io/gwt-maven-plugin/
That however doesn't mean gwt:run and gwt:debug aren't supported: as long as you don't need jetty-web.xml, they work perfectly fine.
Should you use them though? I don't think so (and for many reasons).

Do you test and develop in a Tomcat or what's your preferred setup?

My preferred setup is https://github.com/tbroyer/gwt-maven-archetypes/ , with a clear separation of client and server code. This only works with "that other gwt-maven-plugin" that was specifically designed for multi-module Maven projects (well, technically you can make it work with the "legacy plugin", and early versions of the archetypes did just that, but it's too hackish for me).
(my actual preferred setup is to not build a WAR, and use Gradle rather than Maven, but that's outside the scope of that discussion)
Reply all
Reply to author
Forward
0 new messages